skip to Main Content

The DELETE method is not supported for this route. Supported methods: GET, HEAD – Laravel

My code is: settings.blade.php (blade): <form method="POST" action="{{route('user.settings', $apartment->apartment_id)}}"> @method('delete') @csrf <button type="submit" class="btn btn-danger btn-sm">Delete</button> </form> UserController.php: public function delete(Apartment $apartment) { $apartment->delete(); return redirect()->route('dashboards.users.index') ->withSuccess(__('Deleted successfully')); } web.php: //Authorization based on user role Route::group(['prefix'=>'user', 'middleware'=>['isUser','auth','PreventBackHistory']], function(){ Route::get('dashboard',[UserController::class,'index'])->name('user.dashboard'); Route::delete('settings/{apartment}',[UserController::class,'delete'])->name('settings.delete');…

VIEW QUESTION

Increase variable in column name Laravel

I have those columns in my database table : value_day_1 | value_day_2| value_day_3 |......|value_day_36 I'm trying to display each value in a view using a for loop @for ($n=1;$n<37;n++) {{ $day->value_day_? }} @endfor How can i replace the ? by…

VIEW QUESTION
Back To Top
Search