dimanche 17 juin 2018

Missing required parameter in laravel

I've been trying to get this fixed for days now. I don't know what i'm doing wrong. I'm trying to edit a post in the dashboard. My route looks like this

Route::get('/edit-post/post_id/{post_id}',[
            'as'=>'edit-post',
            'uses'=>'dashboardController@showPostedit',
        ]);

for that route i have a controller

public function showPostEdit(Request $request, Post $post, $post_id){
    $posts= $post->where('post_id',$post_id)->get();

        return view('pages.dashboard.user.edit-post',compact('posts',auth()- 
  >user()->id));
  }

My blade syntax looks like this

  @if(Auth::check())
    @if(auth()->user()->id === $posts->user_id)
        <li class="list-inline-item"><a href=""><span class="fa fa-edit"></span></a></li>
                        <li class="list-inline-item"><a href=""><span class="fa fa-trash"></span></a></li>
                    @endif
            @endif



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire