mercredi 12 décembre 2018

Session expires in laravel and log the user out, after submitting forms

I am developing an application in PHP. When I submit a form Laravel expires the session and then logs the user out.

My view

{!!Form::open(['action' => 'PostsController@store', 'method' => 'POST', 'enctype'=> 'multipart/form-data', 'class'=>'', 'data-smk-icon'=>"fas fa-exclamation"])!!}
      <div class="form-group">
            <label for="titulo" class="label-input100">Title</label>
            <input type="text" name="titulo" class="i form-control">
        </div> @csrf

        <button type="submit"> Publish</button>
    {!!Form::close()!!}

My controller

public function store(Request $request)
{  
    $post = Post::find(2);
    return 'Details:' . $post;
}

My Routes

Route::resource('/artigos','PostsController');

I had to restart the whole project due to this error, but still it persists.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire