This is the reusable library package for Laravel. There are some reusable modules.
- Boilerplate Structure
- Auth Module
- Sample Module
- Permissions and Roles Module
- Blog Module
- Certralized Multiple File
- Notifications (Email, Database and Push)
The Reusable Library Package is a lightweight Laravel package.
The Reusable Library requires
- Laravel v8+ to run.
- enable the "exec" function in php.ini
- Composer 2+(Recommended)
Install the Laravel project by following this link Laravel Document or use the below command:
composer create-project laravel/laravel rl-demo
Install the Reusable Library package. Use the below command:
cd rl-demo(your project root)
composer require bjitgroup/reusable-lib-laravel
Confirm the database connection The correct APP_URL must be specified in the.env file. For example,
APP_URL=localhost:8000
php artisan bjit:reusable-lib-install
Verify the deployment by navigating to your server address in your preferred browser. Use the below command:
php artisan serve
If you choose push notification while setting up the reusable library, you have to run the below command:
php artisan websocket:serve
- Click on one of your preferred browsers.
- Copy localhost:8000/api/documentation and paste it in the browser's url.
File structure flow is as follow
- Route - Configure the route path.
- Controller - Write code as simply as possible in the controller, and call Request Class in the method parameter.
- Request - Form validation is required in this class.
- Service - Write business logic and response data (API).
- Repository - Create, retrieve, update, and delete are actioned in this section.
- Resource - Return the response from service in this section and format it if necessary.
php artisan bjit-make:model Products/Item -m --all
- m => migration
- s => seed
- f => factory
This -mfs --all can be used at the end of the above command.
php artisan bjit-remove:all Products/Item
php artisan bjit:reusable-lib-remove
The Laravel framework is open-sourced software licensed under the MIT license.