Her-Running-Medals is a collection of Laravel 8 Repository Pattern CRUD implementation essentials.
- Form requests
- Request validation
- Responses / API Resources
- Eloquent Relationship
- API Resources (Collections)
- Observer
- Events + Listener
- Unit Tests
- HTTP Tests (EventsApiTest)
Nice To Have:
- Service Container
- FE (React|Vue soon)
$ composer install
$ cp .env.example .env
$ php artisan key:generate
$ php artisan migrate --seed
Create - POST - {localhost}/api/events?eventName={eventName}&location={location}&date={date}
Read - GET (all)- {localhost}api/events
GET (byID) - {localhost}/api/events/{id}
Update - PUT - {localhost}/api/events/{id}?eventName={updatedEventName}&locations={updatedLocation}&date={updatedDate}
Delete - DELETE - {localhost}/api/events/{id}
Create - POST - {localhost}/api/events{event_id}/comments?body={body}
Read - GET (all)- {localhost}api/events{event_id}/comments
Update - PUT - {localhost}/api/events{event_id}/{comment_id}?body={updated_body}
Delete - DELETE - {localhost}/api/events{event_id}/comments/{comment_id}
Create - POST - {localhost}/api/medals?event_id={event_id}&category={category}&image={image}
Read - GET (all)- {localhost}api/medals
GET (byID) - {localhost}/api/medals/{id}
Update - PUT - {localhost}/api/medals/{id}?event_id={updatedEvent_id}&category={updatedCategory}&image={updatedImage}
Delete - DELETE - {localhost}/api/medals/{id}
Create - POST - {localhost}/api/medals{medal_id}/comments?body={body}
Read - GET (all)- {localhost}api/medals{medal_id}/comments
Update - PUT - {localhost}/api/medals{medal_id}/comments/{comment_id}?body={updated_body}
Delete - DELETE - {localhost}/api/medals{medal_id}/comments/{comment_id}
$ php artisan test