This repo can be used to scaffold a Laravel package. Follow these steps to get started:
- Press the "Use this template" button at the top of this repo to create a new repo with the contents of this skeleton.
- Run "php ./configure.php" to run a script that will replace all placeholders throughout all the files.
- Have fun creating your package.
You can install the package via composer:
composer require :vendor_slug/:package_slug
You can publish and run the migrations with:
php artisan vendor:publish --tag=":package_slug-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag=":package_slug-config"
This is the contents of the published config file:
return [
];
Optionally, you can publish the views using
php artisan vendor:publish --tag=":package_slug-views"
$variable = new VendorName\Skeleton();
echo $variable->echoPhrase('Hello, VendorName!');
composer test
The migration system is really simple, you have two choices for the naming convention:
2022_10_12_000000_create_users_table.php
: directly add timestamp and the rest of the file : _create_XXX_tablecreate_users_table.php
: At the migration process the app will add automatically a timestamp. If you don't have any relationship in your migration this case is better.
For seeding you application with the module, your file name need to follow a naming convention:
TableName_v0_0_0_Seeder.php
-
TableName : pascal case
-
_ : separator
-
v0_0_0 : v + version of the seeder or module what you want ( I preconise to follow module version ) : It's usefull because maybe you have model relationShip and you need to seed data before an another seeder. This versionning system allow you to do that.
-
_ : separator
-
_Seeder : end of seeder file
Like this you seeder is correct and you can choose the order of our seeder by table.
Maybe if the need arises, I will add :
ModuleName _ TableName _ v0_0_0 _ Seeder
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.