laravel-6

After uploading Laravel 6.0 project I am getting “The GET method is not supported for this route. Supported methods: POST.” error

时光毁灭记忆、已成空白 提交于 2021-01-27 17:55:43
问题 The project is working on my local server without error. But after uploading the project to the server I am getting The GET method is not supported for this route. Supported methods: POST. error. I used Laravel 6.0 Api.php: Route::post('rates', 'ShippoController@rates'); Controller: public function rates(Request $request){ $validatedData = $request->validate([ 'email' => 'required|email', 'name' => 'required', 'token' => 'required', ]); try{ $carts = Cart::whereToken($request->token)->get();

PHP Error: Call to undefined method stdClass::save() in Psy Shell code on line 1

こ雲淡風輕ζ 提交于 2021-01-05 12:56:53
问题 I'm new in Laravel, I'm using tinker to create a record: $Profile=new \App\Profile(); => App\Profile {#3038} >>> $profile->title='Premier Titre' PHP Warning: Creating default object from empty value in Psy Shell code on line 1 >>> $profile->title='Premier Titre'; => "Premier Titre" >>> $profile->description='Description'; => "Description" >>> $profile->user_id=1; => 1 >>> $profile->save() PH I have the following error:PHP Error: Call to undefined method stdClass::save() in Psy Shell code on

Laravel policies : code change is ignored. Is there any policy cache to clear?

爷,独闯天下 提交于 2020-12-15 08:19:27
问题 I'm working full time on an application for 2 years. I encounter this bug regularily, let's say every couple months, but never manage to fix it in a reliable way because it just disappears and I never get to find the "why". So, here it is again, and I have no clue why and how to fix it. This time, I'm writing something so I'll have a page to favorite for the next time. Here is the bug : If I make any change to a policy method, for instance in app/Policies/UserPolicy, the change is not taken

Laravel policies : code change is ignored. Is there any policy cache to clear?

与世无争的帅哥 提交于 2020-12-15 08:19:00
问题 I'm working full time on an application for 2 years. I encounter this bug regularily, let's say every couple months, but never manage to fix it in a reliable way because it just disappears and I never get to find the "why". So, here it is again, and I have no clue why and how to fix it. This time, I'm writing something so I'll have a page to favorite for the next time. Here is the bug : If I make any change to a policy method, for instance in app/Policies/UserPolicy, the change is not taken

Laravel 6.0 - Custom email verification: temporarySignedRoute() URL not working with new route

巧了我就是萌 提交于 2020-12-08 10:42:51
问题 I'm trying to upgrade to Laravel 6 from 5.8. We're using a custom verification email Notification with the following code to get the verification URL: URL::temporarySignedRoute( 'verification.verify', Carbon::now()->addMinutes(60), [ 'id' => $notifiable->getKey(), ] ); This seems to generate an URL that does not work with the new route (check this), for example: http://host/email/verify/38?expires=1574602925&signature=4410c2230623619633be56d3641814cea3c77236bf8435cba88fc102a35d3dc4 I couldn't