A modern, enterprise-grade inventory management system built with Laravel 12, featuring role-based access control, real-time stock tracking, advanced transaction management, and comprehensive reporting capabilities.
- Complete CRUD operations with advanced filtering and search
- Product categories: Electronics, Clothing, Food, Furniture, and more
- SKU management and cost/price tracking
- Low stock alerts and out-of-stock indicators
- Detailed product pages with full transaction history
- Stock level visualization with Chart.js integration
- Comprehensive supplier database with contact information
- Supplier-product relationship tracking
- Cascade deletion protection (products remain when supplier deleted)
- Advanced filtering and search capabilities
- Beautiful gradient-based UI components
- Real-time inventory tracking with in/out transactions
- Transaction History Preservation - Deletion disabled to maintain complete audit trail
- Reverse Transaction Feature - Undo transactions without deleting history
- Stock validation to prevent negative inventory
- Transaction filtering by type, product, user, and date range
- Automatic quantity calculations
- User tracking for all stock movements
- Admin - Full system access, user management, and configuration
- Warehouse Manager - Inventory operations and reporting access
- No Public Registration - Only admins can create new users
- Profile-based password management for all users
- 20+ reusable Blade components
- Responsive design with Tailwind CSS
- Advanced gradient effects and animations
- Interactive hover states and transitions
- Mobile-optimized navigation
- Beautiful statistics cards and data visualization
- Secure authentication with middleware protection
- Password hashing with bcrypt
- CSRF protection on all forms
- Role-based route middleware
- Email-locked user profiles (admin-only email changes)
- Real-time dashboard statistics
- Low stock and out-of-stock alerts
- Transaction summaries and trends
- Recent activity tracking
- Inventory value calculations
Before you begin, ensure you have the following installed:
- PHP 8.2 or higher
- Composer (PHP dependency manager)
- Node.js 18+ and npm
- SQLite (or MySQL/PostgreSQL)
# 1. Clone the repository
git clone https://github.com/your-username/inventory-system.git
cd inventory-system
# 2. Run automated setup
setup.bat
# 3. Start the server
start.bat# 1. Clone the repository
git clone https://github.com/your-username/inventory-system.git
cd inventory-system
# 2. Install PHP dependencies
composer install
# 3. Install Node.js dependencies
npm install
# 4. Environment setup
cp .env.example .env
php artisan key:generate
# 5. Database setup
php artisan migrate --seed
# 6. Build assets
npm run build
# 7. Start the development server
php artisan serveVisit http://localhost:8000 to access the application.
The system comes pre-seeded with demo accounts for testing:
- Email:
admin@example.com - Password:
password - Role: Administrator
- Permissions: Full system access including user management
- Email:
manager@example.com - Password:
password - Role: Warehouse Manager
- Permissions: Inventory operations and reporting
- Email:
user1@example.com/ Password:password - Email:
user2@example.com/ Password:password
β οΈ Security Notice: Change these default passwords immediately after first login in production environments! Public registration is disabled - only admins can create new users.
| Script | Command | Description |
|---|---|---|
| Setup | setup.bat |
Complete first-time installation |
| Start | start.bat |
Start development server |
| Dev Mode | dev.bat |
Start with hot reloading |
| Maintenance | maintenance.bat |
System maintenance tools |
# Database operations
php artisan migrate # Run migrations
php artisan migrate:fresh --seed # Fresh database with sample data
php artisan db:seed # Seed database with sample data
# Cache management
php artisan cache:clear # Clear application cache
php artisan config:clear # Clear configuration cache
php artisan route:clear # Clear route cache
php artisan view:clear # Clear view cache
# Development
php artisan serve # Start development server
php artisan tinker # Interactive shell
php artisan test # Run testsβββ app/
β βββ Http/Controllers/ # Application controllers
β βββ Models/ # Eloquent models
β βββ Middleware/ # Custom middleware
β βββ Requests/ # Form request validation
βββ database/
β βββ migrations/ # Database migrations
β βββ seeders/ # Database seeders
β βββ factories/ # Model factories
βββ resources/
β βββ views/ # Blade templates
β βββ js/ # JavaScript files
β βββ css/ # Stylesheets
βββ routes/
β βββ web.php # Web routes
β βββ auth.php # Authentication routes
βββ public/ # Public assets
- Comprehensive system overview with 9 statistics cards
- Real-time low stock alerts (β€10 units)
- Recent transaction tracking (last 5 transactions)
- Quick action buttons for common operations
- Responsive grid layout
- Full CRUD operations with validation
- Advanced filtering: stock level, category, supplier
- Real-time search across products and SKUs
- Product details page with transaction history
- Stock level badges (In Stock, Low Stock, Out of Stock)
- Profit margin calculations
- 6 product categories support
- Comprehensive supplier management
- Contact information tracking (email, phone, address)
- Supplier statistics dashboard
- Advanced gradient-based filters UI
- Safe deletion (products remain with null supplier)
- Stock In/Out transaction recording
- History preservation - deletion disabled for audit compliance
- Reverse transaction feature - undo without deleting history
- Advanced filtering: type, product, user, date range
- Stock validation (prevents negative inventory)
- Transaction statistics (total in/out, recent activity)
- User attribution for all transactions
- User creation and management
- Role assignment (Admin, Warehouse Manager)
- Profile editing with password management
- User activity tracking
- No public registration (secure environment)
- Personal information editing
- Password change functionality
- Email locked for security (admin-only changes)
- Activity summary
- Framework: Laravel 12.36.1
- PHP: 8.2.12+
- Authentication: Custom middleware with role-based access
- ORM: Eloquent with relationships and eager loading
- Validation: Form Request classes
- Templating: Blade Components (20+ reusable components)
- CSS Framework: Tailwind CSS 3.4
- JavaScript: Alpine.js for reactive components
- Build Tool: Vite 7.1.12
- Charts: Chart.js for data visualization
- Primary: MySQL 8.0
- Alternative Support: SQLite, PostgreSQL
- Migrations: Version-controlled schema
- Seeders: Sample data for testing (4 users, 6 suppliers, 12 products, 44 transactions)
- Package Manager: Composer, NPM
- Code Style: PSR-12 standards
- Version Control: Git
- Testing: PHPUnit (Feature & Unit tests)
Key environment variables in .env:
APP_NAME="Brandology Inventory System"
APP_ENV=local
APP_DEBUG=true
APP_URL=http://localhost:8000
DB_CONNECTION=sqlite
DB_DATABASE=/path/to/database.sqlite
MAIL_MAILER=smtp
# Configure mail settings for notificationsThe system uses SQLite by default. To use MySQL or PostgreSQL:
- Update
.envfile with database credentials - Run
php artisan migrate --seed
# Run all tests
php artisan test
# Run specific test suite
php artisan test --testsuite=Feature
php artisan test --testsuite=Unit
# Run with coverage
php artisan test --coverage- users - System users with role-based access
- products - Product inventory with categories and pricing
- suppliers - Supplier information and contacts
- stock_transactions - Complete history of stock movements
- cache - Application caching
- jobs - Background job queue
- Products belong to Suppliers (nullable with cascade protection)
- Stock Transactions belong to Products
- Stock Transactions belong to Users (tracking)
- Suppliers have many Products
The system follows the MVC pattern with specialized controllers for each domain. All controllers implement best practices including validation, eager loading, and proper error handling.
Purpose: Central hub for system overview and quick statistics
Key Methods:
index()- Displays comprehensive dashboard with real-time metrics
Features:
- Calculates total products, suppliers, and inventory value
- Identifies low stock items (quantity < 5)
- Shows 5 most recent stock transactions with eager loading
- Uses raw SQL for performance optimization in value calculations
Business Logic:
- Real-time inventory value:
SUM(quantity Γ cost) - Low stock alert threshold: < 5 units
- Transaction history: Latest 5 with product relationships
Purpose: Complete product lifecycle management with advanced filtering
Key Methods:
index()- List products with search, filters, and statisticscreate()- Display product creation formstore()- Validate and save new productedit()- Display product editing formupdate()- Validate and update productdestroy()- Delete productshowDetails()- Detailed product view with transaction history
Advanced Features:
Search Capabilities:
- Multi-field search: name, SKU, category, supplier name
- Supports partial matching with LIKE queries
Filtering System:
- Stock levels: low (β€10), medium (11-50), high (>50), out of stock (0)
- Categories: Electronics, Clothing, Food, Furniture, etc.
- Supplier-based filtering
Statistics Calculation:
- Total products count
- Inventory value:
SUM(price Γ quantity) - Stock distribution: low, medium, high, out of stock
- Category-wise analysis
Product Details Page:
- Complete transaction history with user tracking
- Statistics: total stock in/out, transaction count
- Inventory value calculation
- Chart.js integration for visual data (optional)
- Reverse chronological transaction display
Validation Rules:
- SKU uniqueness across all products
- Non-negative costs and prices
- Positive or zero quantity
- Required supplier relationship
Purpose: Supplier relationship and contact management
Key Methods:
index()- List suppliers with filtering and statisticscreate()- Supplier creation formstore()- Create new supplier with validationedit()- Supplier editing formupdate()- Update supplier informationdestroy()- Safe deletion with cascade protection
Search & Filter Features:
- Multi-field search: name, email, phone, address
- Contact info filters:
- Suppliers with email
- Suppliers with phone
- Suppliers with complete information (all fields filled)
Statistics Dashboard:
- Total suppliers count
- Suppliers with email contact
- Suppliers with phone contact
- Suppliers with complete contact information
Safety Features:
- Cascade protection: Products remain when supplier deleted (set to null)
- Nullable foreign key implementation
- Data integrity preservation
Validation:
- Email format validation
- Phone number max length: 20 characters
- All contact fields optional (flexibility)
Purpose: Inventory movement tracking with audit trail preservation
Key Methods:
index()- Transaction history with advanced filteringcreate()- Transaction entry formstore()- Record new transaction with validationdestroy()- Disabled for audit compliancereverse()- Create reverse transaction to undo effects
Advanced Filtering:
- Transaction type: Stock In / Stock Out
- Product-based filtering
- User-based tracking
- Date range selection
- Sorting by date, quantity, or type
Business Logic:
Stock In Transaction:
- Adds quantity to product inventory
- Records user who performed action
- Optional reason/reference field
- Automatic product quantity update
Stock Out Transaction:
- Validates available stock before processing
- Prevents negative inventory
- Deducts from product quantity
- User attribution and timestamp
Reverse Transaction Feature:
- Creates opposite transaction type (In β Out, Out β In)
- Validates reverse won't cause negative stock
- Maintains complete audit trail
- Links to original transaction in notes
- User tracking for reversal action
Statistics Dashboard:
- Total transactions count
- Stock in/out counts separately
- Total quantities in/out
- Recent activity (last 7 days)
- Transaction volume analysis
Data Integrity:
- Deletion disabled to preserve history
- Immutable transaction records
- Complete audit trail maintenance
- Regulatory compliance support
Purpose: User management and role assignment
Key Methods:
index()- List all users with paginationcreate()- User creation form (admin only)store()- Create user with role assignmentedit()- User editing formupdate()- Update user informationdestroy()- Delete user account
Role-Based Access:
- Admin: Full system access, user management
- Warehouse Manager: Inventory operations only
Security Features:
- Password hashing with bcrypt
- Email uniqueness validation
- Minimum password length: 6 characters
- Optional password update (empty = keep current)
- No public registration (admin-only creation)
Validation Rules:
- Unique email addresses
- Valid email format
- Strong password requirements
- Role restriction to defined values
- Required name field
Purpose: Personal profile management for authenticated users
Key Methods:
show()- Display user profileedit()- Profile editing formupdateProfile()- Update name and passwordupdate()- Advanced profile updatedestroy()- Account deletion
User Capabilities:
- Update personal name
- Change password (optional)
- View account information
- Email locked (admin-only changes for security)
Security Measures:
- Email modification restricted to admins
- Password change requires authentication
- CSRF protection on all forms
- Session-based verification
Profile Features:
- Activity summary display
- Role and permissions visibility
- Account creation date
- Last login tracking (if implemented)
Purpose: Business intelligence and analytics generation
Key Methods:
index()- Comprehensive reports dashboard
Report Types:
Inventory Reports:
- Product quantities analysis
- Stock level distribution (low/medium/high)
- Inventory value calculations
- Category-wise breakdown
Filtering Options:
- Period selection (7, 30, 90 days)
- Stock level filters
- Sorting by quantity, value, or name
Statistical Analysis:
- Total products and stock levels
- Value calculations:
SUM(quantity Γ cost) - Low/medium/high stock counts
- Trend analysis over time
Data Visualization:
- Chart.js integration for graphs
- Product quantity charts
- Stock distribution pie charts
- Transaction trend analysis
Pagination:
- 10 items per page default
- Maintains filter state across pages
- Uses
appends($request->all())for URL parameters
Eager Loading:
- Prevents N+1 query problems
- Uses
with()for relationships - Optimized database queries
Validation:
- Form Request validation
- Server-side validation rules
- User-friendly error messages
- XSS prevention
Security:
- CSRF token verification
- Role-based middleware protection
- Input sanitization
- SQL injection prevention via Eloquent
Performance Optimization:
- Query result caching where appropriate
- Efficient relationship loading
- Raw SQL for complex calculations
- Index usage in database queries
-
Server Requirements:
- PHP 8.2+ with required extensions
- Composer
- Web server (Apache/Nginx)
- Database server
-
Deployment Steps:
# Clone and setup git clone https://github.com/your-username/inventory-system.git cd inventory-system composer install --optimize-autoloader --no-dev npm install && npm run build # Configure environment cp .env.example .env php artisan key:generate # Database setup php artisan migrate --force php artisan db:seed --force # Optimize for production php artisan config:cache php artisan route:cache php artisan view:cache
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow PSR-12 coding standards
- Write tests for new features
- Update documentation as needed
- Use meaningful commit messages
This project is licensed under the MIT License - see the LICENSE file for details.
- Laravel Framework for the robust foundation
- Tailwind CSS for the beautiful styling
- Alpine.js for reactive components
- The open-source community for inspiration
For support, questions, or feature requests:
- Create an issue on GitHub
- Check the documentation in
/docsfolder - Review the inline code comments
Ahmed Essam
- π§ Email: ahmed.essam.dev@gmail.com
- πΌ Full Stack Developer
Made with β€οΈ using Laravel & Tailwind CSS