Answers for "Class 'App\Http\Controllers\Http' not found"

PHP
2

App\\Http\\Controllers\\DB' not found

use Illuminate\Support\Facades\DB
Posted by: Guest on July-05-2020
3

Class 'App\Http\Controllers\Validator' not found

use Illuminate\Support\Facades\Validator;
Posted by: Guest on May-04-2020
0

Class 'App\Http\Controllers\File' not found

// in laravel append the following at the top of controller
use File;
Posted by: Guest on November-01-2020
0

Class 'App\Http\Controllers\View' not found

use Illuminate\Support\Facades\View;

return \View::make('tickets.bus.index');
Posted by: Guest on October-22-2020
0

Class 'App\Http\Controllers\Response' not found

use Response;
Or use full namespace:

return \Response::json(...);
Or just use helper:

return response()->json(...);
Posted by: Guest on June-08-2020
0

Class 'App\Http\Controllers\Validator' not found

public function store()
    {
        $rules = array(
            'name'    => 'required',
        );

        $validator = Validator::make(Input::all(), $rules);

        // if the validator fails, redirect back to the form
        if ($validator->fails()) {
            return Redirect::back()
                ->withErrors($validator) // send back all errors to the login form
                ->withInput();

            $input = input::all();

        } else {

            $company                = New Company();
            $company->name          = Input::get('name');
            $company->user_id       = Input::get('user_id');
            $company->country_id    = Input::get('country_id');
            $company->description   = Input::get('description');

            $company->save();

            return Redirect::to('/backend')->withInput()->with('success', Company added.');

        }
    }
Posted by: Guest on October-20-2020

Code answers related to "Class 'App\Http\Controllers\Http' not found"

Browse Popular Code Answers by Language