Requests


Accessing The Request

To obtain an instance of the current HTTP request via dependency injection, you should type-hint the Shadow\Request\Input class on your controller method. The incoming request instance will automatically be injected by the service container:

<?php

namespace App\Http\Controllers;

class UserController extends Controller
{
    public function store()
    {   
        // get all inputs
        input()->all();

        // get specific input
        input()->get('name');

        // check if its post request or not
        input()->exists('post'); //accepts 'post' and 'get'
    }
}