mercredi 11 juillet 2018

is there a way to insert values to a request (Laravel5)

When I save a post, I want to put the other content as default if the post is empty.

In other words, in the code below, "$request->content" is null.

if (($request->content) == null)
{
    $request->request->add(['content', $request->other_content]);
}
dd($request->content);

I've run my code, but the result of "dd($ request->content)" is still null.
What is wrong?

Thanks in advance your help.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire