laravel get request parameters code example
Example 1: laravel get input from request
public function store(Request $request)
{
$name = $request->input('name');
}
Example 2: laravel get parameters from request
request()->all()
request()->get('param')
request()->only('param1', 'param2')
Example 3: how get some parameter from request in laravel
$data = $request->only(
'project_name',
'project_code',
'block_count',
'unit_count',
'contractor_name',
);
Example 4: laravel get query parameters
$name = $request->query('name', 'Helen');
Example 5: public function store(Request $request)
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class UserController extends Controller
{
public function store(Request $request)
{
$name = $request->input('name');
}
}
Example 6: get value mentthod get laravel
Input::get('lastName') ;