A Laravel-based application for managing customers, contacts, and sales records. This system allows businesses to track customer information, manage their contacts, record sales transactions, and generate sales reports.
- CRUD Operations: Create, read, update, and delete customer records
- Search Functionality: Find customers by name or email
- Detailed Views: See customer details with associated contacts and sales
- Grouping: Organize customers by location or category
- Contact CRUD: Manage contact records for each customer
- Relationship Management: View contacts associated with specific customers
- Transaction Recording: Log sales with date, customer, quantity, and price
- Sales History: View detailed sales records
- Reporting: Generate comprehensive sales reports by time period and customer
- Metrics Tracking: Monitor sales quantities and revenue
- PHP 8.2+
- Laravel 12.0
- MySQL/MariaDB, PostgreSQL, or SQLite
- Composer
-
Clone the repository:
git clone [repository-url] cd customer-management-system -
Install dependencies:
composer install
-
Set up environment variables:
cp .env.example .env
-
Generate application key:
php artisan key:generate
-
Configure database connection in the
.envfile:DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=your_database DB_USERNAME=your_username DB_PASSWORD=your_password -
Run migrations and seed the database:
php artisan migrate php artisan db:seed
-
Start the development server:
php artisan serve
-
Access the application at
http://localhost:8000
| Column | Type | Description |
|---|---|---|
| id | bigint | Primary key |
| name | string | Customer name |
| string | Unique email | |
| phone | string | Contact number |
| address | text | Physical address |
| location | string | City or region |
| category | string | Business category |
| created_at | timestamp | Creation date |
| updated_at | timestamp | Last update date |
| Column | Type | Description |
|---|---|---|
| id | bigint | Primary key |
| customer_id | bigint | Foreign key to customers |
| name | string | Contact name |
| string | Contact email | |
| phone | string | Contact number |
| created_at | timestamp | Creation date |
| updated_at | timestamp | Last update date |
| Column | Type | Description |
|---|---|---|
| id | bigint | Primary key |
| customer_id | bigint | Foreign key to customers |
| sale_date | date | Date of sale |
| quantity | integer | Number of items sold |
| total_price | decimal | Total sale amount |
| notes | text | Optional notes |
| created_at | timestamp | Creation date |
| updated_at | timestamp | Last update date |
| Method | URI | Description |
|---|---|---|
| GET | /customers |
List all customers |
| GET | /customers/create |
Show customer creation form |
| POST | /customers |
Store a new customer |
| GET | /customers/{customer} |
Show a specific customer |
| GET | /customers/{customer}/edit |
Show customer edit form |
| PUT/PATCH | /customers/{customer} |
Update a specific customer |
| DELETE | /customers/{customer} |
Delete a specific customer |
| GET | /customers/group |
Group customers by location or category |
| Method | URI | Description |
|---|---|---|
| GET | /customers/{customer}/contacts |
List all contacts for a customer |
| GET | /customers/{customer}/contacts/create |
Show contact creation form |
| POST | /customers/{customer}/contacts |
Store a new contact |
| GET | /customers/{customer}/contacts/{contact} |
Show a specific contact |
| GET | /customers/{customer}/contacts/{contact}/edit |
Show contact edit form |
| PUT/PATCH | /customers/{customer}/contacts/{contact} |
Update a specific contact |
| DELETE | /customers/{customer}/contacts/{contact} |
Delete a specific contact |
| Method | URI | Description |
|---|---|---|
| GET | /sales |
List all sales |
| GET | /sales/create |
Show sale creation form |
| POST | /sales |
Store a new sale |
| GET | /sales/{sale} |
Show a specific sale |
| GET | /sales/{sale}/edit |
Show sale edit form |
| PUT/PATCH | /sales/{sale} |
Update a specific sale |
| DELETE | /sales/{sale} |
Delete a specific sale |
| GET | /sales-report |
Generate sales reports |
The project uses Laravel Vite with TailwindCSS for frontend assets:
-
Install Node.js dependencies:
npm install
-
Compile assets for development:
npm run dev
-
Build for production:
npm run build
Run the test suite with:
php artisan testAfter seeding, you can log in with:
- Email: test@example.com
- Password: password
This project is open-sourced software licensed under the MIT license.