laravel if request has
snippet in php

laravel if request has

user9046

if ($request->has('name')) {
    //
}

public function store(Request $request)

user4084

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class UserController extends Controller
{
    /**
     * Store a new user.
     *
     * @param  Request  $request
     * @return Response
     */
    public function store(Request $request)
    {
        $name = $request->input('name');

        //
    }
}

laravel get data from request

user574

dd($request->all());
//print an array of the input name and the input value

laravel request has

user290

if ($request->has('name')) {
    //
}