Skip to content

sohag47/cms-api-app

Repository files navigation

Laravel Logo

Build Status Total Downloads Latest Stable Version License

🧰 Tech Stack

🖥️ Server: PHP, Laravel

🗄️ Database: MySQL

💻 Client: React, Redux, TailwindCSS

🚀 Setup Application

📦 Setup dependence

composer install

⚙️ Create .env file and Change DB Credentials

cp .env.example .env

🔐 Generate APP Key

php artisan key:generate

💻 Start Application

php artisan serve

🌐 Start Application with custom IP address and port

php artisan serve --host=0.0.0.0 --port=8080 

💾 Database Actions

Create Model, Migration, Controller file

php artisan make:model Test --migration --controller --resource --api

Create Seeder file

php artisan make:seeder ProductSeeder 

Create Factory file

php artisan make:factory ProductFactory 

Change and affect Database

php artisan migrate
php artisan migrate:refresh --seed 

Single seed

php artisan db:seed --class=BrandSeeder

Run all seeders

php artisan db:seed

Rollback the last database migration

php artisan migrate:rollback

Create a migration file

php artisan make:migration create_flights_table

📦 Important Artisan Command

create resource api route

php artisan make:controller UserController --api

API Resources for Fetching a Single Item and Multiple items

php artisan make:resource UserResource

API Collection for Fetching Custom Collection-Level and Multiple items

php artisan make:resource UserCollection

🧠 Artisan Cache Command

🧹 Clear Cache

# Clear application cache
php artisan cache:clear
# Clear config cache
php artisan config:clear
# Clear route cache
php artisan route:clear
# Clear compiled view files
php artisan view:clear

Clear all caches (application, route, config, view)

php artisan optimize:clear

🗃️ Create Cache

# Cache the configuration files
php artisan config:cache
# Cache the routes
php artisan route:cache
# Cache the views
php artisan view:cache

List all registered routes

php artisan route:list

🐳 Run Application With Docker

# For With Docker
$ cp .env.example .env  #create .env.production file
# change API_HOST, API_PORT 
$ docker compose build --no-cache --force-rm
# build for the production server
$ docker compose up -d
# start the production server
$ docker ps
# Show All Container
$ docker compose down

About

For Content management system(CMS) API Entpoints

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published