Questions tagged [laravel-package]
44 questions
4
votes
1 answer
Could not find a version of package matching your minimum-stability. Require it with an explicit version constraint allowing its desired stability
I've created a package (innovareti/password-policy) and now I am trying to install it, but it is not found:
$ composer require innovareti/password-policy
...
[InvalidArgumentException]
Could not find a version of…

Sonrimos
- 77
- 2
- 9
3
votes
1 answer
Run Laravel Seeder From Package
I'm working on a package for an internal Laravel application and I'm having trouble running a seeder that exists in the package directory.
In my package's composer.json file located in packages/vendor/packagename, I've added the…

Josh
- 714
- 2
- 8
- 20
3
votes
1 answer
Laravel Splade "old input or default variable"?
I am using the Laravel Splade package, I want old input when there is any validation error, and the page is refreshed; here is my input field.
{{-- Interact with the value of the data --}}

Abid Raheem
- 47
- 6
3
votes
1 answer
Check if migration exists in Laravel package service provider
I'm writing a Laravel package, in its service provider, the package receives a list of migrations to publish, using the code below:
protected function publishMigrations(array $publishables): void
{
// Generate a list of migrations that have not…

Mike Elahi
- 1,103
- 1
- 13
- 28
3
votes
0 answers
Can you append custom env fields automatically with laravel package
I am trying to create a laravel package and it requires a level of abstraction where user of the package is ment to input an API key. So i made an API KEY field in the .env, with a config file of course..
my question is, is it possible to append…

Gabe
- 136
- 2
- 11
2
votes
1 answer
Localization in a custom Laravel Package
My service provider of my custom package has the following lines in the boot() method:
$this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'name');
$this->publishes([
__DIR__.'/../resources/lang' =>…

JanBoehmer
- 395
- 3
- 14
2
votes
2 answers
Use Explicit or Implicit Model Binding on Routes in Laravel Package
I am migrating some app functionality into a Laravel package. The package includes Models, Controllers and routes. I am using Laravel 9
Everything is working except my Models are not biding to the routes so the models are not being automatically…

Kerkness
- 329
- 4
- 9
2
votes
0 answers
Developing Laravel Package - How to access artisan commands
I have been working on a new Laravel package where I've manually created the directory structure then manually make the controllers and then add my package into a main laravel 8 project which all works fine but when developing the package you don't…

Boardy
- 35,417
- 104
- 256
- 447
2
votes
1 answer
Laravel Package: How to register a third party facade inside a custom package?
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":…

Philipp Mochine
- 4,351
- 10
- 36
- 68
1
vote
2 answers
How to display the Mews Captcha by 5 characters
I am using the Mews package as Captcha in my Laravel app.
So I tried installing it via this command and published the assets as well:
composer require mews/captcha
Then in the Blade, I added this:

Pouya
- 114
- 1
- 8
- 36
1
vote
1 answer
cant install swagger package using laravel
when i try to install swagger package i got this warrning
Failed to download swagger-api/swagger-ui from dist: The zip extension and unzip/7z commands are both missing, skipping.
The php.ini used by your command-line PHP is:…

mohammad bagri
- 23
- 4
1
vote
0 answers
Laravel Package that has own db connection
I am developing a package that has its own routes controllers and migrations and everything. I want to add db connection to it. Once Package Service is used by client using its route it has to go its own database connection.
Once the package…
1
vote
3 answers
Laravel kreait/laravel-firebase install failed
I am working on a project and tried to install firebase package using:
composer require kreait/laravel-firebase
But it returns different errors:
Using version ^4.1 for kreait/laravel-firebase
./composer.json has been updated
Running composer…

Hammad Butt
- 73
- 2
- 7
1
vote
0 answers
How to test routes that are added dynamically by Laravel package
I want to create a package from a module that I created in my project but can't figure out how to cover the package with tests.
The package will add some routes and it should allow choosing which ones to add and what prefix to use.
I suppose it's…

Kārlis Janisels
- 1,265
- 3
- 18
- 41
1
vote
0 answers
use Laravel Excel inside laravel package development
I'm creating my own Laravel package for the first time. I create a new project and require orchestra/testbench in the project. Things look okay and I'm able to run tests inside the package but I couldn't use Laravel Excel inside my package.
in…

Anurat Chapanond
- 2,837
- 3
- 18
- 31