DEV Community

Cover image for [solved] Class 'App\Http\Controllers\Storage' not found - Laravel 9
dev laravel
dev laravel

Posted on

4 2

[solved] Class 'App\Http\Controllers\Storage' not found - Laravel 9

This article give on: Class ‘App\Http\Controllers\Storage’ Not Found. here laravel simple solution is here now get storage not found on this error and laravel 8 use get a*pp/http/controllers/storage solved*.

are you follow me and get this error solve laravel 6, laravel 7, laravel 8, laravel 9 get solved.

having an error:
Class ‘App\Http\Controllers\Storage’ not found
Class 'App\Http\Controllers\Storage' not found in laravel, Class 'App\Http\Controllers\Storage' not found
Solution 1: Out of Class ‘App\Http\Controllers\Storage’ not found
You need to import Storage class because it’s a facade.

Add.

use Storage;

At your Project Controller:

For example: Class ‘App\Http\Controllers\Storage’ not found

<?php

namespace App\Http\Controllers;

use Storage;

class UserController {
   ...
}
Enter fullscreen mode Exit fullscreen mode

Solution 2:
You must add this line of import use storage is use Illuminate\Support\Facades\Storage;

use Illuminate\Support\Facades\Storage;

Final Code is:

now paste this code and get this your storage is found were well.

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;

class UserController extends Controller

{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index(Request $request)
    {
        Storage::put('ads.txt', 'Contents');

        return view('_MY_BLOGS');
    }
}
Enter fullscreen mode Exit fullscreen mode

I hope it can help you…

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay