skip to Main Content

404 not found when i try to delete some of my post – Laravel

I try to delete some of my post with slug but it's not found. My route: Route::resource('/dashboard/berita', DashboardController::class)->parameters([ 'berita' => 'post:slug' ])->middleware('auth'); My Controller: public function destroy(Post $post) { $post->delete(); return redirect('/dashboard/berita')->with('success', 'Berita sudah dihapus!'); } My blade: <form action="{/dashboard/berita/{{…

VIEW QUESTION

How to read a parameter coming from the with method to the view in laravel

I have this route in web.php: Route::get('student/evaluation/{evaluation}', [EvaluationController::class, 'getEvaluationQuestions'])->middleware('auth')->name('student.questionsevaluation'); And in my controller I have this condition, where $questionWasCompleted is boolean if($questionWasCompleted){ return redirect()->route('student.questionsevaluation', $evaluation) ->with('message', 'Question answered.') ->with('question', $questionWasCompleted); } How can I get the value of $questionWasAnswered to…

VIEW QUESTION

Laravel: How do you pass data to a blade.php?

I am having difficulty in understanding how to pass data to a .blade. I want to pass the users' username ($user) to a dashboard component. Here's a few things I've tried: return view('livewire.dashboard', ['user'=>'$user']); return view('livewire.dashboard', compact('$user')); return view('livewire.dashboard'->with('user',$user)); But…

VIEW QUESTION
Back To Top
Search