Skip to content

AlexisVS/multipass-module-skeleton

Repository files navigation

:package_description

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads


This repo can be used to scaffold a Laravel package. Follow these steps to get started:

  1. Press the "Use this template" button at the top of this repo to create a new repo with the contents of this skeleton.
  2. Run "php ./configure.php" to run a script that will replace all placeholders throughout all the files.
  3. Have fun creating your package.

Installation

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"

Usage

$variable = new VendorName\Skeleton();
echo $variable->echoPhrase('Hello, VendorName!');

Testing

composer test

Migrations

The migration system is really simple, you have two choices for the naming convention:

  1. 2022_10_12_000000_create_users_table.php : directly add timestamp and the rest of the file : _create_XXX_table
  2. create_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.

Seeders

For seeding you application with the module, your file name need to follow a naming convention:

TableName_v0_0_0_Seeder.php

  1. TableName : pascal case

  2. _ : separator

  3. 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.

  4. _ : separator

  5. _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

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

This is the module repository skeleton for crafting anew module

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published