lsnepomuceno / laravel-package-maker
Get a package skeleton and all other `make` commands from laravel base for package development.
Fund package maintenance!
LSNepomuceno
Installs: 11
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 32
Open Issues: 0
Type:package
Requires
- illuminate/console: ^7.0|^8.0|^9.0
- illuminate/filesystem: ^7.0|^8.0|^9.0
- illuminate/support: ^7.0|^8.0|^9.0
Requires (Dev)
- mockery/mockery: ^1.4
- nunomaduro/collision: ^5.9.0
- orchestra/testbench: ^5.0|^6.0
- dev-main
- v5.0.0
- v4.0.4
- v4.0.3
- v4.0.2
- v4.0.1
- v4.0.0
- v3.1.0
- v3.0.2
- v3.0.1
- v3.0.0
- 2.0.0
- v1.4.4
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.4
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3
- 1.2.x-dev
- v1.2.9
- v1.2.8
- v1.2.7
- v1.2.6
- v1.2.5
- v1.2.4
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1
- v1.0
- dev-laravel-9-support
- dev-prepare-upgrade
- dev-dev
This package is auto-updated.
Last update: 2024-10-29 05:54:13 UTC
README
forked from Naoray/laravel-package-maker
All the make
commands you use in your daily Laravel app development workflow but for packages! This package was created solely for the purpose to make package development as fast and easy as possible. Creating a new package only takes one command (make:package
) and you will end up with the following file structure:
.
└── package
├── .codecov.yml
├── composer.json
├── CONTRIBUTING.md
├── .gitignore
├── LICENSE.md
├── phpunit.xml
├── readme.md
├── src
│ └── PackageServiceProvider.php
├── .styleci.yml
├── tests
│ └── TestCase.php
└── .travis.yml
Install
composer require lsnepomuceno/laravel-package-maker --dev
Usage
Create a package
php artisan make:package
Create a nova tool
php artisan make:nova
Inspired by Spatie's nova-skeleton-tool this command clones the repository, replaces all strings with your own and adds it to your own project.
Add a package
php artisan package:add
If you have already created a package or you want to add a modified version of a package which is currently only available locally, you can use the following command to add you package to your project. It does simply add your package to your project`s composer repositories and requires a local version of it.
This command is run by make:package
automatically, so you have no need to execute it after creating a package!
Save package credentials
php artisan package:save
{namespace : Root namespace of the package (Vendor\Package_name)}
{path : Relative path to the package's directory}
Every package:*
command needs to know the package's namespace and the relative path to the location your package is stored. Because of that every package:*
command comes with those two options by default. To avoid entering those two options every time a package:*
command executed this command saves the credentials of your package in the cache.
Delete package credentials
php artisan package:delete
This one wipes all stored credentials from your cache.
Clone a package
php artisan package:clone
{src : Source path of the package to clone}
{target : Path where it should be cloned in}
The clone command clones a given repository or directory into the given target.
Replace Content
php artisan package:replace
{path : The path to a file or directory}
{--O|old=* : Old strings which will be replaced}
{--N|new=* : New strings which will be used as replacement}'
The replace command takes a path of a file or a directory and an indefinite number of 'old' options which will be replaced by the 'new' options.
Make Commands
All of these commands do have all arguments & options to which you are used to in a normal laravel app! To execute any of these commands simply add the prefix package:
.
Foundation
channel
console
event
exception
job
listener
mail
model
notification
observer
policy
provider
request
resource
rule
test
Database
factory
migration
seeder
Routing
controller
middleware
Standard Php
All of the following routes only accept a name
argument.
contract
interface
(same ascontract
)trait
Commands used for creating initial package stubs
package:basetest {provider : The package's provider name}
- createsTestCase
intests
folderpackage:codecov
- creates a.codecov.yml
filepackage:composer {--author : The author of the package.} {--email : The author's email.}
- createscomposer.json
package:contribution
- createsCONTRIBUTING.md
package:gitignore
- creates.gitignore
filepackage:license {--copyright : The company or vendor name to place it int the license file}
- createsLICENSE.md
filepackage:phpunit
- createsphpunit.xml
package:readme {--author : The author of the package.} {--email : The author's email.}
- createsreadme.md
package:styleci
- creates.styleci.yml
package:travis
- creates.travis.yml
Example Usage
Use a few make
commands
All arguments & options you know from the standard make
commands are available. Create a model with all option.
Testing
Run the tests with:
vendor/bin/phpunit
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Credits
Security
If you discover any security-related issues, please email krishan.koenig@googlemail.com instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.