Laravel - Class "Input" not found - Solved

By Hardik Savani April 16, 2024 Category : Laravel

Hey Guys,

This post is focused on laravel Input class not found. This article goes in detailed on Laravel Class "App\Http\Controllers\Input" not found. I would like to show you laravel Input password class not found. you'll learn laravel Input not found. follow the below example for Class 'App\Http\Controllers\Input' not found in laravel.

You can solve 'Class "App\Http\Controllers\Input" not found' issue in laravel 6, laravel 7, laravel 8, laravel 9, laravel 10 and laravel 11 version.

A few days ago I was working on my laravel app and I simply get all Inputs of folder using Input. When I run the project then I found 'Class "App\Http\Controllers\Input" not found' error. you can see bellow screenshot as well.

After some research, I found that If you are using the "Input" class in Controller, Middleware, or blade Input then you must have used facade on top.

so let's see bellow solution and example code here:

Solution:

You must need to add "use Illuminate\Support\Facades\Input;" on top of controller, middleware, command, event or blade Inputs. Let's see bellow:

use Illuminate\Support\Facades\Input;

Example:

You can see controller Input code, how to use it.

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use Illuminate\Support\Facades\Input;

class UserController extends Controller

{

/**

* Display a listing of the resource.

*

* @return \Illuminate\Http\Response

*/

public function index(Request $request)

{

$input = Input::all();

return view('users');

}

}

I hope it can help you...

laravel Input class not found, Laravel Class "App\Http\Controllers\Input" not found, laravel Input password class not found, laravel Input not found, Class 'App\Http\Controllers\Input' not found in laravel, class Input not found laravel

Tags :
Shares