To start container
git clone [email protected]:mhojaguliyev/pet_shop.git
cd pet_shop
cp .env.example .env
docker run --rm --interactive --tty --volume $PWD:/app composer install --ignore-platform-reqs --no-scripts
docker-compose up -d --build
Migrate data with seeding
docker exec -i app php artisan migrate --seed
Seeding categories and products with dummy data
docker exec -i app php artisan db:seed --class=CategoryProductSeeder
Run larastan
docker exec -i app ./vendor/bin/phpstan analyse
Run tests
docker exec -i app php artisan test
Run php insights
docker exec -i app php artisan insights
Clone the repository
git clone [email protected]:mhojaguliyev/pet_shop.git
Switch to the repo folder
cd pet_shop
Install all the dependencies using composer
composer install
Copy the example env file and make the required configuration changes in the .env file
cp .env.example .env
Generate a new application key
php artisan key:generate
Run the database migrations (Set the database connection in .env before migrating)
php artisan migrate --seed
Start the local development server
php artisan serve --port=8888
You can now access the server at http://localhost:8888/api/v1
Make sure you set the correct database connection information before running the migrations Environment variables
php artisan migrate --seed
php artisan serve --port=8888
- tymondesigns/jwt-auth - For authentication using JSON Web Tokens
app
- Contains all the Eloquent modelsapp/Enums
- Contains the Enumsapp/Filters
- Contains the Eloquent Filter classesapp/Http/Controllers
- Contains all the controllersapp/Http/Middleware
- Contains the middlewaresapp/Http/Requests
- Contains all the api form requestsapp/Http/Resources
- Contains all the api resource filesconfig
- Contains all the application configuration filesdatabase/factories
- Contains the model factory for all the modelsdatabase/migrations
- Contains all the database migrationsdatabase/seeds
- Contains the database seederroutes
- Contains all the api routes defined in api_v1.php filetests
- Contains all the application teststests/Feature
- Contains all the api feature teststests/Unit
- Contains all the api unit tests
.env
- Environment variables can be set in this file
Note : You can quickly set the database information and other variables in this file and have the application fully working.
The api documentation can be accessed at http://localhost:8888.
After seeding the database,
- The default admin credentials are:
- Email - [email protected]
- Password - 123456
- The default user credentials are:
- Email - [email protected]
- Password - 123456