MadMaks
246
3
Laravel

Multiple Post requests to one page

Posted 3 months ago by MadMaks

Hi @all, Is there a simple way, to make two post request with the same action url? Maybe with the id or the name of the forms? I tried this but it doesn't work:(

Route::post('/Video/{slug}' , ['video-comment' , 'uses' => '[email protected]']);
    Route::post('/Video/{slug}' , ['video-like' , 'uses' => '[email protected]'] );

and my forms look like this:

<form method="POST" action="/Video/{{$videoPost->slug}}" id="video-like" name="video-like">
    {{csrf_field()}}
        <button type="submit">Like</button>
    </form>

Thanks in advance for any replies:)

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.