video-thumbnail icon indicating copy to clipboard operation
video-thumbnail copied to clipboard

Class "App\Http\Controllers\VideoThumbnail" not found

Open seoasia-co opened this issue 1 year ago • 8 comments

local.ERROR: Class "App\Http\Controllers\VideoThumbnail" not found {"userId":1,"exception":"[object] (Error(code: 0): Class "App\Http\Controllers\VideoThumbnail" not found at /app/Http/Controllers/MainController.php:316)

seoasia-co avatar Jun 04 '23 06:06 seoasia-co

I've tried all php artisan optimize:clear and composer dump-autoload

seoasia-co avatar Jun 04 '23 06:06 seoasia-co

I looks like it tries to find VideoThumbnail class in your /app/Http/Controllers folder, did you used right namespace for VideoThumbnail Facade?

pawlox avatar Jun 04 '23 07:06 pawlox

I follow your instruction and add in config.php 'providers' Pawlox\VideoThumbnail\VideoThumbnailServiceProvider::class, and alias 'VideoThumbnail' => Pawlox\VideoThumbnail\Facade\VideoThumbnail::class,

that 's it all I saw in your instruction.

seoasia-co avatar Jun 04 '23 07:06 seoasia-co

Need I have to create controller? php artisan make:controller VideoThumbnail ?

but I saw the same problem in many forum and they run php artisan cache:clear then it work. but It's not for me.

seoasia-co avatar Jun 04 '23 07:06 seoasia-co

for example https://stackoverflow.com/questions/55494689/class-videothumbnail-for-found-in-laravel

seoasia-co avatar Jun 04 '23 07:06 seoasia-co

Composer install:

composer require pawlox/video-thumbnail After package installation, add the ServiceProvider to the providers array in config/app.php

Pawlox\VideoThumbnail\VideoThumbnailServiceProvider::class And to the aliases array

'VideoThumbnail' => Pawlox\VideoThumbnail\Facade\VideoThumbnail::class Also you can publish package config file with:

php artisan vendor:publish --tag=video-thumbnail and set ffmpeg and ffprobe paths in .env file:

FFMPEG="/usr/bin/ffmpeg" FFPROBE="/usr/bin/ffprobe"

seoasia-co avatar Jun 04 '23 07:06 seoasia-co

then I call this in the place I should call in other controller

VideoThumbnail::createThumbnail( public_path('files/movie.mp4'), public_path('files/thumbs/'), 'movie.jpg', 2, 1920, 1080 );

seoasia-co avatar Jun 04 '23 07:06 seoasia-co

Try to add

use Pawlox\VideoThumbnail\Facade\VideoThumbnail;

at the top of the controller.

pawel-omniaz avatar Jun 04 '23 14:06 pawel-omniaz