reusable-lib-laravel maintained by bjitgroup
Description
A BJIT Reusable Laravel Package
Author
Last update
2025/01/29 12:05
(dev-main)
License
Downloads
492
Tags
BJIT Reusable Library Package
Overview
The BJIT Reusable Library Package is a lightweight and modular Laravel package designed to provide reusable components and features to streamline development.
Features
- 🔥 Boilerplate Structure
- 🔐 Auth Module
- 🏗 Sample Module
- 🎛 Permissions & Roles Management
- 📝 Blog Module
- 📁 Centralized File Handling
- 🔔 Notifications (Email, Database, Push)
Installation
Requirements
- Laravel v8+ (Latest Supported)
- PHP with
execfunction enabled - Composer v2+ (Recommended)
Step 1: Install Laravel
composer create-project laravel/laravel rl-demo
Step 2: Install the Reusable Library
cd rl-demo # Navigate to the project root
composer require bjitgroup/reusable-lib-laravel
Version Compatibility
| Laravel Version | Package Version | Installation Command |
|---|---|---|
| 11.x | Latest | composer require bjitgroup/reusable-lib-laravel |
| 9.x - 10.x | 2.x | composer require bjitgroup/reusable-lib-laravel:2.* |
| 8.x | 1.x | composer require bjitgroup/reusable-lib-laravel:1.* |
- Laravel 11.x : Use
composer require bjitgroup/reusable-lib-laravel - Laravel 9.x to 10.x : Use
composer require bjitgroup/reusable-lib-laravel:2.* - Laravel 8.x : Use
composer require bjitgroup/reusable-lib-laravel:1.*
Step 3: Configure the .env File
Ensure the correct database connection and APP_URL settings:
APP_URL=http://localhost:8000
Step 4: Install the Reusable Library
php artisan bjit:reusable-lib-install
Step 5: Serve the Application
php artisan serve
Push Notification Setup
For Laravel 11.x (Reverb)
php artisan reverb:start
For Laravel 8.x - 10.x (Websockets)
php artisan websocket:serve
For Queue Processing
php artisan queue:work
Client-Side Configuration
- Configure the client application with Key, Host, and Port.
- Build the frontend application:
npm run build
API Documentation (Swagger)
Access the API documentation by opening your browser and navigating to:
http://localhost:8000/api/documentation
File Structure
The package follows a modular structure:
- Route - Configure API routes.
- Controller - Handle requests and responses.
- Request - Form validation logic.
- Service - Business logic handling.
- Repository - Database operations (CRUD).
- Resource - API response formatting.
Generate Module Files
php artisan bjit-make:model Products/Item -m --all
Options:
-m→ Create migration-s→ Create seed file-f→ Create factory
You can also use -mfs --all at the end of the command to generate a migration, seed, and factory simultaneously.
Generate Service or Repository
php artisan bjit-make:service Products/ProductBrand
php artisan bjit-make:repository Products/ProductBrand
Remove a Module
php artisan bjit-remove:all Products/Item
Uninstall Reusable Library
php artisan bjit:reusable-lib-remove
License
This package is open-source software licensed under the MIT License.