lundi 3 décembre 2018

laravel 5.7 how to pass request of controller to model and save

I am new in laravel and I am trying to pass $request from a function in controller to a function in model.

THis is my controller function:

PostController.php

public function update(PostUpdateRequest $request, post $post)
{

    $post->title = $request->title;
    $post->description = $request->description;

    $post->save();

    return redirect(route('post.index'));

}

how save data in model ?

Thanks



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2DWzIdw
via IFTTT

Aucun commentaire:

Enregistrer un commentaire