Build a system using Laravel framework for a Pharmacy where any user can add pharmacies and products to them, and also he can add price and quantity of every Product in every pharmacy.
- pharmacies (name & address):
- Products: [title,description,image]
- ProductPharmacy: [product_id,pharmacy_id,quantity,price]
Notes:
- product_id is the id of product.(F.K).
- pharmacy_id is the id of pharmacy (F.K).
- Price is the product price in specific pharmacy refered by pharmacy_id.
- quantity is the product quantity in this pharmacy :)
- make Models, Migration & relations between tables plus laravel UI.
composer require laravel/ui.- make CRUD For Product and Pharmacy plus addPrice and quantity for for every product in every pharmacy, Extra search on product in product dashboard page :) and rendering products like :).
- make command Line for search and get The Five cheapest prices for product given and the pharmacies details
php artisan products:search-cheapest 2. - Make Pharmacy Api with Resources for rendering json data
http://127.0.0.1:8000/api/v1/pharmaciesand for productshttp://127.0.0.1:8000/api/v1/products - and Search product query by title or address
127.0.0.1:8000/api/v1/products?title[eq]=ddd&description[like]=kkdkkd - make Factories and seeders for create 50K products and 20K pharmacies and their relation :) for testing :)
php artisan migrate:fresh seed. - Complete All Coding Until Finish :)
To clone the project you must follow the following steps:
- Navigate to the main page of the repository.
- Above the list of files, click Code button and copy the https link.
- Go to your visual studio code editor then open the terminal and write this command git clone with https linK.
- Copy .env.example file to .env on the root folder. You can type copy .env.example .env if using command prompt Windows or cp .env.example .env if using terminal, Ubuntu.
- Open your .env file and change the database name to
yourname, username (DB_USERNAME) and password (DB_PASSWORD) field correspond to your configuration. - open Mysql Host and create Database with
yournamewith your above configuration. - Run
composer install - Run
php artisan key:generate - Run
php artisan migrate - Run
php artisan db:seedif you want to make atest on some faker data :) - Run
php artisan serveand start Manage products & pharmacies in Pharmacy App :)