Guide to cloning and setting up a Laravel project, connecting it to a database, and migrating the database.
Make sure you have the following installed on your machine:
git clone https://github.com/IGedeMiarta/jobseeker-test.git
cd jobseeker-test
composer install
Copy the .env.example
file to create a new .env
file:
cp .env.example .env
Open the .env file and configure your database connection:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=db_test
DB_USERNAME=root
DB_PASSWORD=
Run the following command to migrate the database:
php artisan migrate
If you want to populate the database with Faker data, use the --seed
flag
php artisan migrate --seed
php artisan serve
Visit http://localhost:8000
in your browser to access the Laravel application.
GET /api/v1/candidate
Parameter | Type | Description |
---|---|---|
email |
string |
search by email |
phone |
string |
search by phone_number |
fullname |
string |
search by full_name |
dob |
date |
search by date of birth dd/mm/yyyy |
pob |
string |
search by place of birth |
gender |
string |
search by gender (only F or M ) |
year_exp |
integer |
search by year of experience |
salary |
integer |
search by of last salary |
search |
string |
search email, phone_number, full_name, pob |
order |
string |
filter by [ASC ,DESC ] |
paginate |
integer |
order paginate (default 10) |
Example Request With Parameter:
GET /api/v1/candidate?pob=denpasar&gender=F&paginate=50
The data where will returns candidate where place of birth is in denpasar, and gender female, the data will show per 50 items
POST api/v1/candidate
Parameter | Type | Description |
---|---|---|
email |
string |
required, email, unique |
phone_number |
string |
required, unique |
full_name |
string |
required |
dob |
date |
required,yyyy-mm-dd |
pob |
string |
required |
gender |
string |
required,only(F ,M ) |
year_exp |
integer |
required |
last_salary |
integer |
optional |
GET api/v1/candidate/{id}
Parameter | Type | Description |
---|---|---|
id |
string |
Required. candidate_id of item to fetch |
PUT api/v1/candidate/{id}
Parameter | Type | Description |
---|---|---|
id |
string |
Required. candidate_id of item to fetch |
POST Parameter:
Parameter | Type | Description |
---|---|---|
email |
string |
required, email, unique |
phone_number |
string |
required, unique |
full_name |
string |
required |
dob |
date |
required,yyyy-mm-dd |
pob |
string |
required |
gender |
string |
required,only(F ,M ) |
year_exp |
integer |
required |
last_salary |
integer |
optional |
DELETE api/v1/candidate/{id}
Parameter | Type | Description |
---|---|---|
id |
string |
Required. candidate_id of item to fetch |