Laravel Package Development Boilerplate

Laravel May 29, 2018

Package Link :


  • Make package structure within a second
  • Adding package resource using command line
  • Easy way to define your package custom structure
  • Adding custom stubs facilities


Go to terminal and run this command

composer require shipu/laratie

Wait for few minutes. Composer will automatically install this package for your project.

For Laravel

Below Laravel 5.5 open config/app and add this line in providers section


Now run this command in your terminal to publish this package resources:

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

Quick Usages

Go to terminal and run this command

php artisan package:create vendor package_name
php artisan p:c vendor/package_name
php artisan p:c

Then run composer dump-autoload;

Package Resources

if you want to create your package resource then run below command:

php artisan package:file vendor/package --stubkey=fileName
php artisan p:f vendor/package --stubkey=fileName

Suppose you want make a controller for your package then:

php artisan package:file vendor/package --controller=TestController

Available stubKey :


If you have your own custom stubKey then you can choose --key for create package resource and value will be your stubKey.

Package Root Directory

If you need to change your all packages root directory then Open config/tie.php and update root directory path.

'root'          => base_path('packages'), // Base directory

Pckage Owner

Open config/tie.php for setup your vendor name and rootNamespace. It's not mendatory.

'vendor'        => '', // Your github username. For Example 'vendor' => 'shipu'
'rootNamespace' => '', // Root Namespace For Example: 'rootNamespace'   => 'Shipu'

Package Structure

Open config/tie.php for setup your own package structure. Available configuration:

return [
    'stubs' => [
        'structure' => [
            'stubKey' => [
                'namespace' => 'Namespace',
                'case'  => 'choose one from [lower, upper, snake, title, camel, kebab, studly']' // default studly
                'path' => 'your_path/folderName',
                'suffix' => 'FileNameSuffix',
                'prefix' => 'PrefixFileName',
                'extension' => 'file extension. dot php as default file extension'
                'files' => [
                    //  default file here
            // or
            'stubKey' => 'your_path/folderName'

Package Stub configuration

Open config/tie.php :

return [
    'stubs' => [
        'path'      => [
            // adding more stub path for customize stub or new stub
        'default'   => [
            // default stub key here, For Example your stubkey look like
        'root'      => 'stubKey', // folder path which is concating with vendor/package on composer.json

String Replacement

For replace string to another string on stub template. Open config/tie.php :

return [
    'stubs' => [
        'replace'   => [
            // ADD YOUR REPLACEMENT STRING. For Example:
            'REPLACEMENT_KEY'    => 'Replacement String',
            'VENDOR_NAME_LOWER'  => 'shipu',
            'VENDOR_NAME'        => 'Shipu',


Security Vulnerabilities

If you discover a security vulnerability within LaraTie, please send an e-mail to Shipu Ahamed via [email protected].


The LaraTie package is open-sourced software licensed under the MIT license.


Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.