laravel

MethodNotAllowedHttpException, redirect to 404

徘徊边缘 提交于 2021-02-10 05:51:10
问题 This is the list of a group of controllers: Route::group([ 'prefix' => 'some-prefix', ], function () { Route::get('/', 'MyController@index')->name('some-prefix'); Route::post('/get', 'MyController@getData')->name('some-prefix.get'); Route::get('/getall/{type}', 'MyController@getAllData')->name('some-prefix.getall'); Route::get('/create', 'MyController@create')->name('some-prefix.create'); Route::post('/', 'MyController@store')->name('some-prefix.store'); Route::get('/edit', 'MyController@edit

Laravel installation sail problem ((23) Failed writing body)

本小妞迷上赌 提交于 2021-02-10 05:51:10
问题 I tried to install laravel with this command on CMD ; curl -s https://laravel.build/example-app | bash but I got this error (23) Failed writing body When I tried with PowerShell I got this error; cmdlet Invoke-WebRequest at command pipeline position 1 Supply values for the following parameters: Uri: curl : Cannot find drive. A drive with the name 'https' does not exist. At line:1 char:1 curl -s https://laravel.build/example-app | bash ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CategoryInfo :

How to dispatch a job before running queue:work command

蹲街弑〆低调 提交于 2021-02-10 05:32:43
问题 I want to make queue for email notifications and this notification is used for logging into website. So at the notification file I implemented ShouldQueue and then I ran php artisan queue:table & php artisan migrate on terminal successfully. After that I changed QUEUE_CONNECTION on .env to database and finally tried to run php artisan queue:table after runing php artisan serve but it freezes at all: I even ran php artisan config:clear and php artisan queue:work again but still freezes! UPDATE

Laravel Mix Bootstrap Glyphicons not loading

安稳与你 提交于 2021-02-10 05:18:46
问题 I created a new laravel application and added the auth template. I tried to add this button: <button type="button" class="btn btn-default btn-lg"> <span class="glyphicon glyphicon-stop" aria-hidden="true"></span> </button> But the glyphicons are not loading I get this error in my Chrome console: GET http://localhost/fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.woff2?448c34a56d699c29117adc64c43affeb GET http://localhost/fonts/vendor/bootstrap-sass/bootstrap/glyphicons

Laravel Mix Bootstrap Glyphicons not loading

隐身守侯 提交于 2021-02-10 05:18:44
问题 I created a new laravel application and added the auth template. I tried to add this button: <button type="button" class="btn btn-default btn-lg"> <span class="glyphicon glyphicon-stop" aria-hidden="true"></span> </button> But the glyphicons are not loading I get this error in my Chrome console: GET http://localhost/fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.woff2?448c34a56d699c29117adc64c43affeb GET http://localhost/fonts/vendor/bootstrap-sass/bootstrap/glyphicons

Laravel Mix Bootstrap Glyphicons not loading

耗尽温柔 提交于 2021-02-10 05:18:05
问题 I created a new laravel application and added the auth template. I tried to add this button: <button type="button" class="btn btn-default btn-lg"> <span class="glyphicon glyphicon-stop" aria-hidden="true"></span> </button> But the glyphicons are not loading I get this error in my Chrome console: GET http://localhost/fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.woff2?448c34a56d699c29117adc64c43affeb GET http://localhost/fonts/vendor/bootstrap-sass/bootstrap/glyphicons

Laravel + PhpStorm: is it possible jump to function from routes definition in one step?

时间秒杀一切 提交于 2021-02-10 04:13:50
问题 We have quite a lot routes, such as: Route::get('/','WebController@index'); When I want to jump to function, I have to: go to the class WebController go to the function index() Is it possible jump to function from routes definition in one step? 回答1: You should have to install plugin for laravel in php strom. - Under Settings (Preferences) | Plugins, click the Browse repositories... button and search for Laravel . Next, we can use the Install plugin button or the context menu to proceed with

How to return one instance of a eloquent many to many relation with eager loading?

老子叫甜甜 提交于 2021-02-10 03:54:48
问题 class Parent extends Model { public function kids() { return $this->belongsToMany('App\Models\Kid') ->orderBy('age') ->withTimestamps(); } public function oldestKid() { return $this->belongsToMany('App\Models\Kid') ->orderByDesc('age') ->take(1); } } Problem with this approach is that $parent->oldestKid returns an array. It would feel more logical if it would return an object. $parent = App\Models\Parent::with('oldestKid')->first(); 回答1: This is what we ended up with, and its working.

Function for resend email takes me to the home page and does nothing in the given function - Laravel

≯℡__Kan透↙ 提交于 2021-02-10 03:26:19
问题 I have this simple function on click to send email to the users if the first one after registration didnt go. But when i click on the button it doesn nothing and takes me to the home page. The resend function: protected function resend() { $user = Account::where('email', Auth::user()->email)->first(); $user->verifyToken = Str::random(40); $user->save(); $this->sendEmail($user); return redirect(route('verifyEmail'))->with('user',$user)->with('success', 'A link has been sent to your email'); }

Function for resend email takes me to the home page and does nothing in the given function - Laravel

我只是一个虾纸丫 提交于 2021-02-10 03:22:11
问题 I have this simple function on click to send email to the users if the first one after registration didnt go. But when i click on the button it doesn nothing and takes me to the home page. The resend function: protected function resend() { $user = Account::where('email', Auth::user()->email)->first(); $user->verifyToken = Str::random(40); $user->save(); $this->sendEmail($user); return redirect(route('verifyEmail'))->with('user',$user)->with('success', 'A link has been sent to your email'); }