Skip to content

jsafe00/her-running-medals-api

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
app
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Buy Me A Coffee

Her-Running-Medals is a collection of Laravel 8 Repository Pattern CRUD implementation essentials.

Laravel 8 Repository Pattern using

  • 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)

Install with Composer

    $ composer install

Set Environment

    $ cp .env.example .env

Note: Don't forget to set your db settings

Set the application key

   $ php artisan key:generate

Run migrations and seeds

   $ php artisan migrate --seed

To execute

Event

    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}

Event Comment

    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}

Medal

    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}

Medal Comment

    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}

To test

   $ php artisan test

About

Laravel 8 Repository Pattern Essentials

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published