This is a simple project to implement Service-Repository Design Pattern using Laravel. To be known :
The repository
is a layer between the domain and data layers of your application with an interface to perform create, read, update and delete CRUD operations. By using repositories in your application, you allow CRUD operations for an object to be handled by one class which can then be injected into other areas of your code.Services
is a layer for the business logic of your application. It simply performs the a set task (e.g. calculating a loan, updating a user) using the information provided, using any repositories or other classes you have created outside of the service.
The idea of the Repository and Service pattern are to keep the business logic (services) and the data access logic (repositories) of your app contained in their own sections. So, it's making code more readable, expandable and maintenaceable.
This section should list any major frameworks that you built your project using. Leave any add-ons/plugins for the acknowledgements section. Here are a few examples.
And supporting tools to easy testing like :
So, let start it.
- After clone this repository, just run
composer update
. - Setup your
.env
file such as database connection depend on you existing device. - To make sure that all dependency is run well, than run
php artisan migrate
to doing migration and migrate all databse that we provide in this project. - Than you can run
php artisan db:seed
if you need seeder for user, or you can manualy register user with register endpoint. - Finally, you can run your project with command:
php artisan serve
. - Go to postman and set url like
http://localhost:8000/api/
, for information that port to run this project depend on configuratin on.env
Hopefully, it can be easily understood and useful. Thank you~