This project is a Laravel application that serves as a product catalog. Provide an API to browse products and categories, subscribe to a newsletter, and receive updates about featured products.
- Browse products and categories
- Filter products and categories by name
- View products and categories by slug
- Subscribe and unsubscribe to newsletters
- Receive a welcome email upon subscription
- Weekly newsletter with featured products
- Admin panel to manage products and categories
- PHP >= 8.2
- Composer
- Laravel >= 11.x
- MySQL or any supported database
Follow these steps to set up and run the project locally.
Run the following command to install the required packages:
composer install
Copy the example environment file:
cp .env.example .env
Then, update the .env
file with your database credentials and mail configuration.
Generate an application key:
php artisan key:generate
To run migrations and optionally seed the database, you can use the custom Artisan command:
php artisan app:init
This command will:
- Run all migrations.
- Prompt you to run seeders.
- Ask for an email and password to create a new user.
Run the following command to start the development server:
php artisan serve
You can now access the application at http://localhost:8000
.
To send newsletters weekly, set up a cron job to run the Laravel scheduler or run the queue worker:
- List Categories:
GET /api/categories?name=example
- View Category by Slug:
GET /api/categories/slug/{slug}
- List Products:
GET /api/products?name=example
- View Product by Slug:
GET /api/products/slug/{slug}
- Subscribe:
POST /api/subscribe
(requires an email) - Unsubscribe:
POST /api/unsubscribe
(requires an email)
You can access to the admin panel /admin
- Laravel
- PHP
- MySQL
- Blade (for views)
- Eloquent ORM
- Filament (Admin panel)
This project is licensed under the MIT License.