Home > Blockchain >  Laravel collective action
Laravel collective action

Time:08-09

I am beginner at laravel. I want to use laravel collective (on laravel 9 version). And actually i want to use action. I write it in my blade:

{!! Form::open(['action' => 'PostsController@store', 'method' => 'POST']) !!}

{!! Form::close() !!}

and when i open it in browser it gives me error Action PostsController@store not defined. i do not know. help me. i try to googled it but did not find. also i tried [PostsController::class] but not worked. i tried everything what i know

CodePudding user response:

The other way around is just call the route name.

<form action="{{ route('your.route.name') }}">
   ...
</form>

CodePudding user response:

{!! Form::open(['route' => 'route.name', 'method' => 'POST']) !!}
{!! Form::close() !!}
  • Related