GithubHelp home page GithubHelp logo

shipu / laratie Goto Github PK

View Code? Open in Web Editor NEW
63.0 5.0 15.0 98 KB

Laravel Package Development Boilerplate Generator.

License: MIT License

PHP 100.00%
php laravel stub stubs generator package tools development

laratie's Introduction

Laravel Package Development Boilerplate.

Features

  • Make package structure within a second
  • Adding package resource using command line
  • Easy way to define your package custom structure
  • Adding custom stubs facilities
  • Support Spatie Laravel Package Tools (Read More)
  • Support Filament Plugin Development (Read More)

Installation

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

Shipu\Tie\LaravelTieServiceProvider::class,

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 with replace vendor to your username and package_name to your package name

php artisan package:create vendor package_name
or 
php artisan package:create vendor/package_name
or 
php artisan package:create

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
or 
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 :

--controller 
--command 
--events
--facades
--config
--migration
--job
--provider
--routes
--middleware
--class 
--exceptions
--key

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:

<?php
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
                    'default.extension',
                    'default.php',
                    'default.ini',
                    'default.jpg',
                    'PACKAGE_NAME.php'
                ]
            ],
            // or
            'stubKey' => 'your_path/folderName'
        ]
        ...
    ]
    ...
];

Package Stub configuration

Open config/tie.php :

<?php
return [
    ...
    'stubs' => [
        'path'      => [
            // adding more stub path for customize stub or new stub
            base_path('vendor/shipu/laravel-tie/src/Consoles/stubs'),
        ],
        'default'   => [
            // default folder structure with stub key
            'composer',
            'src',
            'config',
            //'provider', // laravel service provider
            //'filament-plugin-provider', // please uncomment if you need filament plugin service provider
            'spatie-provider', // spatie service provider. comment if you using filament plugin provider
            'tests',
        ],
        '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',
        ],
        ...
    ]
    ...
];

Credits

Security Vulnerabilities

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

License

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

laratie's People

Contributors

shipu avatar zafree avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

laratie's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.