I am not sure but after composer update, I updated media library, and EloquentSluggable.
Now the media conversations dont work anymore.
this is my user class:
use Illuminate\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
use Illuminate\Support\Facades\Hash;
use Spatie\MediaLibrary\HasMedia\HasMediaTrait;
use Spatie\MediaLibrary\HasMedia\Interfaces\HasMedia;
use Spatie\MediaLibrary\HasMedia\Interfaces\HasMediaConversions;
use Zizaco\Entrust\Traits\EntrustUserTrait;
use Cviebrock\EloquentSluggable\SluggableInterface;
use Cviebrock\EloquentSluggable\SluggableTrait;
class User extends Model implements AuthenticatableContract, CanResetPasswordContract, HasMediaConversions, SluggableInterface
{
use Authenticatable, CanResetPassword, EntrustUserTrait, HasMediaTrait, SluggableTrait;
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'users';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['username', 'name', 'lastname', 'email', 'password', 'city_id', 'country_id', 'verified', 'email_token'];
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected $hidden = ['password', 'remember_token'];
protected $sluggable = [
'build_from' => 'username',
'save_to' => 'slug',
'on_update' => true,
];
/**
* User profile picture conversions
*/
public function registerMediaConversions()
{
$this->addMediaConversion('thumb')
->setManipulations(['w' => 60, 'h' => 60])
->performOnCollections('avatars');
$this->addMediaConversion('medium')
->setManipulations(['w' => 350, 'h' => 250, 'fit' => 'crop'])
->performOnCollections('avatars');
}
Am I doing something wrong? every thing was working fine before the updates.
The, what it seems, glide error I am getting now:
Whoops, looks like something went wrong.
1/1
InvalidArgumentException in Api.php line 60:
Not a valid manipulator.
in Api.php line 60
at Api->setManipulators(array(object(Orientation), object(Rectangle), object(Size), object(Brightness), object(Contrast), object(Gamma), object(Sharpen), object(Filter), object(Blur), object(Pixelate), object(Output))) in Api.php line 31
at Api->__construct(object(ImageManager), array(object(Orientation), object(Rectangle), object(Size), object(Brightness), object(Contrast), object(Gamma), object(Sharpen), object(Filter), object(Blur), object(Pixelate), object(Output))) in GlideApiFactory.php line 43
at GlideApiFactory::create() in GlideImage.php line 99
at GlideImage->save('C:\wamp\www\baseapp\storage\medialibrary/temp/0oj6DPZaRxmdnbmZ/oKIX5wjtxnw4srNzthumb.jpg') in FileManipulator.php line 96
at FileManipulator->performConversion(object(Media), object(Conversion), 'C:\wamp\www\baseapp\storage\medialibrary/temp/0oj6DPZaRxmdnbmZ/a13fqEIQjJd4yhEq.jpg') in FileManipulator.php line 65
at FileManipulator->performConversions(object(ConversionCollection), object(Media)) in PerformConversions.php line 38
at PerformConversions->handle()
at call_user_func_array(array(object(PerformConversions), 'handle'), array()) in Container.php line 503
at Container->call(array(object(PerformConversions), 'handle')) in Dispatcher.php line 193
at Dispatcher->Illuminate\Bus\{closure}(object(PerformConversions))
at call_user_func(object(Closure), object(PerformConversions)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(PerformConversions))
at call_user_func(object(Closure), object(PerformConversions)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Dispatcher.php line 205
at Dispatcher->dispatchNow(object(PerformConversions), object(Closure)) in CallQueuedHandler.php line 43
at CallQueuedHandler->call(object(SyncJob), array('command' => 'O:43:"Spatie\MediaLibrary\Jobs\PerformConversions":5:{s:14:"*conversions";O:51:"Spatie\MediaLibrary\Conversion\ConversionCollection":1:{s:8:"*items";a:2:{i:0;O:41:"Spatie\MediaLibrary\Conversion\Conversion":4:{s:7:"*name";s:5:"thumb";s:16:"*manipulations";a:1:{i:0;a:2:{s:1:"w";i:60;s:1:"h";i:60;}}s:23:"*performOnCollections";a:1:{i:0;s:7:"avatars";}s:17:"*performOnQueue";b:1;}i:1;O:41:"Spatie\MediaLibrary\Conversion\Conversion":4:{s:7:"*name";s:6:"medium";s:16:"*manipulations";a:1:{i:0;a:3:{s:1:"w";i:350;s:1:"h";i:250;s:3:"fit";s:4:"crop";}}s:23:"*performOnCollections";a:1:{i:0;s:7:"avatars";}s:17:"*performOnQueue";b:1;}}}s:8:"*media";O:45:"Illuminate\Contracts\Database\ModelIdentifier":2:{s:5:"class";s:25:"Spatie\MediaLibrary\Media";s:2:"id";i:58;}s:5:"queue";N;s:5:"delay";N;s:6:"*job";N;}')) in Job.php line 129
at Job->resolveAndFire(array('job' => 'Illuminate\Queue\CallQueuedHandler@call', 'data' => array('command' => 'O:43:"Spatie\MediaLibrary\Jobs\PerformConversions":5:{s:14:"*conversions";O:51:"Spatie\MediaLibrary\Conversion\ConversionCollection":1:{s:8:"*items";a:2:{i:0;O:41:"Spatie\MediaLibrary\Conversion\Conversion":4:{s:7:"*name";s:5:"thumb";s:16:"*manipulations";a:1:{i:0;a:2:{s:1:"w";i:60;s:1:"h";i:60;}}s:23:"*performOnCollections";a:1:{i:0;s:7:"avatars";}s:17:"*performOnQueue";b:1;}i:1;O:41:"Spatie\MediaLibrary\Conversion\Conversion":4:{s:7:"*name";s:6:"medium";s:16:"*manipulations";a:1:{i:0;a:3:{s:1:"w";i:350;s:1:"h";i:250;s:3:"fit";s:4:"crop";}}s:23:"*performOnCollections";a:1:{i:0;s:7:"avatars";}s:17:"*performOnQueue";b:1;}}}s:8:"*media";O:45:"Illuminate\Contracts\Database\ModelIdentifier":2:{s:5:"class";s:25:"Spatie\MediaLibrary\Media";s:2:"id";i:58;}s:5:"queue";N;s:5:"delay";N;s:6:"*job";N;}'))) in SyncJob.php line 44
at SyncJob->fire() in SyncQueue.php line 27
at SyncQueue->push(object(PerformConversions)) in Dispatcher.php line 269
at Dispatcher->pushCommandToQueue(object(SyncQueue), object(PerformConversions)) in Dispatcher.php line 244
at Dispatcher->dispatchToQueue(object(PerformConversions)) in Dispatcher.php line 176
at Dispatcher->dispatch(object(PerformConversions)) in DispatchesJobs.php line 18
at FileManipulator->dispatch(object(PerformConversions)) in FileManipulator.php line 148
at FileManipulator->dispatchQueuedConversions(object(Media), object(ConversionCollection)) in FileManipulator.php line 42
at FileManipulator->createDerivedFiles(object(Media)) in Filesystem.php line 41
at Filesystem->add('C:\wamp\tmp/php8513.tmp', object(Media), '_downloadfiles_wallpapers_1920_1200_widescreen_color_pulse_wallpaper_abstract_3d_wallpaper_1920_1200_widescreen_75.jpg') in FileAdder.php line 306
at FileAdder->toCollectionOnDisk('avatars', 'avatars') in UsersController.php line 28
at UsersController->avatarUpload(object(Request), 'admin')
at call_user_func_array(array(object(UsersController), 'avatarUpload'), array(object(Request), 'slug' => 'admin')) in Controller.php line 76
at Controller->callAction('avatarUpload', array(object(Request), 'slug' => 'admin')) in ControllerDispatcher.php line 145
at ControllerDispatcher->call(object(UsersController), object(Route), 'avatarUpload') in ControllerDispatcher.php line 93
at ControllerDispatcher->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in ControllerDispatcher.php line 95
at ControllerDispatcher->callWithinStack(object(UsersController), object(Route), object(Request), 'avatarUpload') in ControllerDispatcher.php line 54
at ControllerDispatcher->dispatch(object(Route), object(Request), 'App\Http\Controllers\Front\UsersController', 'avatarUpload') in Route.php line 204
at Route->runWithCustomDispatcher(object(Request)) in Route.php line 135
at Route->run(object(Request)) in Router.php line 685
at Router->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in AuthorizeMiddleware.php line 38
at AuthorizeMiddleware->handle(object(Request), object(Closure))
at call_user_func_array(array(object(AuthorizeMiddleware), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Authenticate.php line 45
at Authenticate->handle(object(Request), object(Closure))
at call_user_func_array(array(object(Authenticate), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Router.php line 687
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 660
at Router->dispatchToRoute(object(Request)) in Router.php line 636
at Router->dispatch(object(Request)) in Kernel.php line 236
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in VerifyCsrfToken.php line 64
at VerifyCsrfToken->handle(object(Request), object(Closure))
at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in StartSession.php line 62
at StartSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure))
at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in CheckForMaintenanceMode.php line 42
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Kernel.php line 122
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 87
at Kernel->handle(object(Request)) in index.php line 54
The basic error is of course:
InvalidArgumentException in Api.php line 60:
Not a valid manipulator.
when i dd here:
/**
* Set the manipulators.
* @param array $manipulators Collection of manipulators.
*/
public function setManipulators(array $manipulators)
{
foreach ($manipulators as $manipulator) {
if (!($manipulator instanceof ManipulatorInterface)) {
dd($manipulator);
throw new InvalidArgumentException('Not a valid manipulator.');
}
}
$this->manipulators = $manipulators;
}
i get:
Orientation {#336}
and then it throws "Not a valid manipulator"
the conversions are still the same:
public function registerMediaConversions()
{
$this->addMediaConversion('thumb')
->setManipulations(['w' => 60, 'h' => 60])
->performOnCollections('avatars');
$this->addMediaConversion('medium')
->setManipulations(['w' => 350, 'h' => 250])
->performOnCollections('avatars');
}