This repository contains a Laravel 8 application built using PHP 7.3. The application focuses on managing movies, directors, actors, and TV shows through a RESTful API. Follow the instructions below to set up and run the application.
- PHP 7.3
- Composer
- Database MySQL
- Clone this repository to your local machine:
git clone <repository_url>
-
Create a
.env
file in the root directory of the project. You can use the provided.env.example
file as a template. -
Configure the database connection in the
.env
file by setting the appropriate database driver, host, port, database name, username, and password. -
Open a terminal and navigate to the project directory.
-
Install the project dependencies using Composer:
composer install
- Generate a new application key:
php artisan key:generate
- Generate the JWT secret key:
php artisan jwt:secret
-
Create the desired database for the application in your chosen database management system.
-
Run database migrations to create the necessary tables:
php artisan migrate
-
Register User:
- Endpoint:
../public/api/register
- Method: POST
- Endpoint:
-
Login:
- Endpoint:
../public/api/login
- Method: POST
- Endpoint:
-
Logout:
- Endpoint:
../public/api/logout
- Method: POST
- Endpoint:
-
User:
- Endpoint:
../public/api/user
- Method: GET
- Endpoint:
-
Create a movie (Requires a created director):
- Endpoint:
../public/api/moviecreate
- Method: POST
- Endpoint:
-
Get movies (Filter by id, genre, title, or retrieve all):
- Endpoint:
../public/api/movie
- Method: GET
- Endpoint:
-
Create an actor:
- Endpoint:
../public/api/actorcreate
- Method: POST
- Endpoint:
-
Get actors (Filter by name or actor_id):
- Endpoint:
../public/api/actor
- Method: GET
- Endpoint:
-
Create a director:
- Endpoint:
../public/api/directorcreate
- Method: POST
- Endpoint:
-
Get directors (Filter by name or director_id):
- Endpoint:
../public/api/director
- Method: GET
- Endpoint:
-
Create a TV show:
- Endpoint:
../public/api/tvshowcreate
- Method: POST
- Endpoint:
-
Get TV shows (Filter by id, genre, title, or retrieve all):
- Endpoint:
../public/api/tvshow
- Method: GET
- Endpoint:
-
Create episodes for a TV show:
- Endpoint:
../public/api/addepisodes
- Method: POST
- Endpoint:
-
Get episodes by TV show id:
- Endpoint:
../public/api/episode
- Method: GET
- Endpoint:
-
Add actors to a movie:
- Endpoint:
../public/api/addactormovie
- Method: POST
- Endpoint:
-
Add actors to a TV show:
- Endpoint:
../public/api/addactortv
- Method: POST
- Endpoint: