binded name, emailand role from the User Modell to the Member Modell
tried to write a jurnal for the progress: jurnal.md, but it is now partially outdated
project ist ready to use, SQLite database and no secrets in the .env file
initial commit
03.11.23
rebuild the way to divide the User-roles (using Middleware)
moved the code from the MemberController to the Member Model
use Scopes to filter the Member
use select & join to get the data from the database
made a benchmark against withs and joinis faster
added inviteMail endpoint to send an email to a new Member
added register endpoint to register a new Member
use the customJson to format the response inkl. Exception handling
Issues
handle two different roles (staff, member) with the same user table is annoying. For every request we need to check the role and get the data from the right table. And both table have timestamps. Is there a better way?
There will be no response after a Member is deleted
I a non existing Member is requested, there will be an ugly response:"message": "No query results for model [App\\Models\\Member]
decide if we sort out the active member in the backend (/member?active) or in the frontend
ToDo
better error messages:
if a Member is deleted, there should be a response
if an email is already in use and a new Member is created with this email, there should be a response
All requests and responses are of an application/json content type and follow typical HTTP response status codes for success and failure.
200 - Everything is OK
201 - Created Successfully
202 - Accepted
204 - No Content
301 - Moved Permanently
400 - Bad Request
401 - Unauthorized
404 - Not Found
500 - Internal Server Error
The API follows the general rule that all 200 codes are deemed successful, 300 codes denote a redirection, 400 codes are client errors and 500 codes are server errors.