Skip to content

Make your package development easier with package template.

License

Notifications You must be signed in to change notification settings

anandmainali/PackageTemplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PackageTemplate

Latest Version forks stars license Total Downloads

Package template helps to create a structure of package with single command. It also provides other commands to generate files just as in laravel.

Installation

Use the package manager composer to install PackageTemplate.

composer require anandmainali/packagetemplate

Enable the package (Optional)

This package implements Laravel auto-discovery feature. After you install it, the package provider and facade are added automatically for laravel >= 5.5.

Configuration

After installation, you have to publish config file.

php artisan vendor:publish --tag=package-config

This will generate package.php file inside the config folder.

Package.php

<?php

return [
  /**
   * Main folder to holds all the packages. Contains packages with VendorName. 
   */
  'path' => 'packages',
  
  /**
   * The VendorName will be generated inside the main folder.
   */
  'vendorName' => "VendorName",
  
  /**
   * These are the folders that will be generated while creating package.
   */
  'folders' => [
    'controllers', 'database/migrations', 'models', 'policies', 'resources/views', 'routes'
  ],
  
  /**
   * These are the files that will be generated while creating package.
   */
  'files' => ['routes/web']

];

Now, you can start building your package. To generate package,

php artisan create:package PackageName

And, all the files and folders you specified in config.php will be generated.

Other Available Commands with php artisan

Note:- The PackageName is used to generate files inside the package.

create:model ModelName PackageName
create:controller ControllerName PackageName --r //--r is optional. It is used to create resource controller.
create:migration MigrationName TableName PackageName
create:policy PolicyName PackageName
create:command CommandName --command=command:name PackageName

About

Make your package development easier with package template.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages