You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
6 days ago | |
---|---|---|
Modules/Api | 3 weeks ago | |
app | 6 days ago | |
bootstrap | 3 weeks ago | |
config | 3 weeks ago | |
database | 6 days ago | |
docker | 4 weeks ago | |
public | 3 weeks ago | |
resources | 3 weeks ago | |
routes | 6 days ago | |
storage | 3 weeks ago | |
stubs/nwidart-stubs | 3 weeks ago | |
tests | 4 weeks ago | |
.editorconfig | 4 weeks ago | |
.env.example | 3 weeks ago | |
.gitattributes | 4 weeks ago | |
.gitignore | 4 weeks ago | |
README.md | 4 weeks ago | |
artisan | 4 weeks ago | |
composer.json | 3 weeks ago | |
docker-compose.yml | 4 weeks ago | |
modules_statuses.json | 3 weeks ago | |
package-lock.json | 4 weeks ago | |
package.json | 4 weeks ago | |
phpunit.xml | 4 weeks ago | |
postcss.config.cjs | 4 weeks ago | |
tailwind.config.js | 4 weeks ago | |
vite-module-loader.js | 3 weeks ago | |
vite.config.js | 4 weeks ago |
README.md
Laravel 12 - Content Management Project (Dockerized)
This project is a content management system (CMS) built with Laravel 12, running in a development environment powered by Docker + Docker Compose It integrates modern Laravel tools including:
- Livewire – For building reactive components using Blade.
- Passport – Provides API authentication using OAuth2.
- Vite – Bundles and hot-reloads frontend assets efficiently.
🛠 Requirements
Component | Description |
---|---|
Laravel 12 | Primary PHP framework using MVC architecture |
PHP 8.4 (FPM) | Latest version of PHP with high performance |
MySQL 8 | Relational database management system |
Nginx | Lightweight and fast web server for handling HTTP requests |
Docker | Isolated and portable containerized environment |
Docker Compose | Manage multiple containerized services in one configuration |
Composer | PHP dependency manager |
🚀 Install
1. Clone the project
git clone
cd project
2. Create the .env file
cp .env.example .env
📄 Example .env
Configuration
APP_URL=http://localhost:8080
DB_CONNECTION=mysql
DB_HOST=db
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=laravel
DB_PASSWORD=secret
SESSION_DRIVER=database
3. Build and start Docker containers
docker-compose up -d --build
4. Run composer to install package and NPM
composer install --ignore-platform-reqs
npm install
5. Generate application key
php artisan key:generate
🔐 API Authentication with Laravel Passport
Laravel Passport provides a complete OAuth2 authentication system for your Laravel APIs. Below are the steps to install and configure Passport for this Laravel 12 (Dockerized) project.
1. Create a Password Grant Client
php artisan passport:client --password
2. Get an Access Token via API
Endpoint:
POST http://<url_local>:<port>/oauth/token
Headers:
Accept: application/json
Content-Type: application/x-www-form-urlencoded
Body:
grant_type=password
client_id=YOUR_CLIENT_ID
client_secret=YOUR_CLIENT_SECRET
username=test@example.com
password=secret123
scope=
✅ Successful Response
{
"token_type": "Bearer",
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGci...",
"expires_in": 3600
}