laravel-5.5

Laravel Dusk test for remote site not work

旧巷老猫 提交于 2019-12-13 03:43:27
问题 ... $this->browse(function (Browser $browser) { $browser->visit(url()->route('login')) ->type('email', 'user.one@email.com') ->type('password', 'something') ->press('Login') ->pause(60*60*1000) ->assertRouteIs('dashboard') ... It works on local which is use APP_URL something like 'https://project.dev' but not work for remote 'https://project.com' and 'http://123.123.12.12'. Errors or Problems login test on remote site not work Different between local and remote dusk installed in local dusk

Unknown column 'username' in Laravel

走远了吗. 提交于 2019-12-13 03:31:19
问题 Been trying to solve this for 2 days now. When I try to seed user data to my database, I get: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'username' in 'field list' (SQL: insert into users ( name , username , password , email , updated_at , created_at ) values (tony, tony_admin, $2y$10$lBDvjtEu.tYueU AuRutTteHLmOntXSBAZsX.tO.ZK3RtxwiLXOBGW, tony_admin@laravel.com, 2018-02-18 00:12:39, 2018-02-18 00:12:39)) User.php class User extends Authenticatable { use Notifiable; protected

Laravel 5.5 - Class Custom BaseController not found but exists

守給你的承諾、 提交于 2019-12-13 02:57:42
问题 Laravel 5.5 Custom BaseController not found even though it exists. Have checked the other questions on StackOverflow regarding the BaseController not found but they are referring to the default BaseController which isn't the same in mine case. Here is my implementation Controller.php use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Routing\Controller as CheckController; use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Foundation\Auth\Access\AuthorizesRequests

Get related data through relation

让人想犯罪 __ 提交于 2019-12-13 00:35:17
问题 I am using laravel 5.5.13. I have App\Entity which has many App\Comment 's and many App\Thumb 's. Now I am able to fetch the Comments and Thumbs easily like this: public function show(Entity $entity) { return $entity->load('comments')->load('thumbs'); } This gives data like this: { "id": 1, "kind": null, "name": "three", "created_at": "2017-11-01 04:29:22", "updated_at": "2017-11-01 04:29:22", "comments": [ { "id": 5, "body": "no non o", "displayname_id": 4, "entity_id": 1, "created_at":

Laravel 5.5: PHPUnit (with coverage) doesn't like routes from multiple files and throws “A facade root has not been set”. Without coverage it's green

喜欢而已 提交于 2019-12-12 15:14:28
问题 I have Laravel 5.5 where I decided to group routes in files to organise them in a more meaningful way. Here's a simplified example - the web route files live in: app/Http/Routes/Web/static.php app/Http/Routes/Web/test.php static.php contains: <?php declare(strict_types=1); namespace Foo\Http\Routes\Web; use Illuminate\Support\Facades\Route; Route::get('/', function () { return view('welcome'); }); test.php contains: <?php declare(strict_types=1); namespace Foo\Http\Routes\Web; use Illuminate

How can I get seprate quiestion ID in foreach loop?

时光总嘲笑我的痴心妄想 提交于 2019-12-12 07:00:15
问题 I am new in laravel, I am making quiz application in laravel, I got this issue @include('inc.header') <br> <div class="container"> <div class="row"> <form method="POST" action="{{ url('/store-quiz') }}" class="" id="quiz_module"> {{ csrf_field() }} @foreach($questions as $question) @if($id == $question->category_id) <legend> Quiz Of {{ $question->category->title }}</legend> <div class="jumbotron"> <input type="hidden" name="user_id" value="{{ auth()->user()->id }}"> <input type="hidden" name=

Asynchronous Laravel Jobs

不打扰是莪最后的温柔 提交于 2019-12-12 04:45:51
问题 I want to run asynchronous Laravel jobs and work forever. As far as I understand, I need to setup Jobs and push them into separate queues. I have set .env - QUEUE_DRIVER=database and run php artisan queue:table and php artisan migrate accordingly. and I have run php artisan make:job MyJob (at this point queues table is empty though, but I don't know if I did something wrong) The point I mainly got confused is how is it going to start all the jobs and run them forever, or run the job initially

Laravel 5.5 - How to query notifications for follower with created_at timestamp?

左心房为你撑大大i 提交于 2019-12-11 18:35:46
问题 A user can be a follower and/or a leader. Here userA and userB (both leaders) were followed by userC (follower) at different times (see followers table below for created_at timestamp). To illustrate the issue, I will first layout the template: userX action (year) // template to understand issue below userC followed userA (2016) userA added postA/notification (2017) userC should get notification in feed, since they followed userA a year BEFORE their post userB added postB/notification (2018)

Change Base URL in Laravel 5.5

北城余情 提交于 2019-12-11 17:42:10
问题 I 'm trying to change the base URL http://myscreenclass.com/ to http://myscreenclass.com/home . I changed the .env file and updated the config/app.php file as well. I tried to solve the issue many different ways, but nothing happens. How can I change the URL? 回答1: I am trying to change base URL http://myscreenclass.com/ to http://myscreenclass.com/home May I suggest reading up on routing with Laravel? You can achieve this by adding this to your web routes file. Route::redirect('/', '/home');

DevTools in vue.js

人走茶凉 提交于 2019-12-11 17:17:38
问题 I am using vue.js inside Laravel 5.5.33 (not SPA). I am getting below error. How can I enable DevTools? 回答1: Be sure you have this setting in your app.js file Vue.config.devtools = true If you are using mix, check the dist of vue in webpack.mix, be sure you don't use min version mix.js('resources/js/app.js', 'public/js') .sass('resources/sass/app.scss', 'public/css') .webpackConfig({ resolve: { alias: { 'vue$': 'vue/dist/vue.js' } } }); Run your npm in dev npm run watch WARNING If you refresh