Category : laravel-package

Hello All I am trying to get validate file in laravel with custom package but i give the error of the "Method IlluminateHttpUploadedFile::validate does not exist." so please know what is a problem. MyController code: $files=$request->file(‘image’); if($files){ $oGreetr = new Greetr(); return $oGreetr->file_size($files); } Package Code: public function file_size($file){ //return $file->getClientOriginalExtension(); return $file->validate([ ‘image’ => ..

Read more

I’m creating a package that uses internally this hashid package. How can I register a third party facade inside a custom package? I tried three options and none of them worked. Version – Composer "aliases": { "Hashids": "VinklaHashidsFacadesHashids" } Version – inside my ServiceProvider with alias class MyPackageServiceProvider extends ServiceProvider { public function register() { ..

Read more

I’m building a Laravel Package. I need to publish my custom migrations. One migration need another one to be run because it has a foreign key constraint. In my service provider I’m doing this: public function boot(Filesystem $filesystem) { $this->loadMigrationsFrom(dirname(__DIR__).’/migrations’); $this->publishMigrations($filesystem); } private function publishMigrations(Filesystem $filesystem) { if (! class_exists(‘CreateReferencedTable’)) { $this->publishes([ __DIR__ . ‘/../database/migrations/create_referenced_table.php.stub’ ..

Read more

enter image description here I tried installing Laravel packages on my EC2 server on AWS via puTTY but everytime i run installation commands for a Laravel package, It shows a warning message (as shown in the image) and after that crashes with the same message: In RemoteFilesystem.php line 560: The "http://repo.packagist.org/p/provider-2013%24373e592feb042f51b8ed82f090 6531e330bdd926e48324f0393ad8c54afb6b5c.json" file could not ..

Read more