Skip to content

Instantly share code, notes, and snippets.

@BastinRobin
Created March 27, 2018 08:39
Show Gist options
  • Select an option

  • Save BastinRobin/f9beba447310b9ea41663c7b6671e47f to your computer and use it in GitHub Desktop.

Select an option

Save BastinRobin/f9beba447310b9ea41663c7b6671e47f to your computer and use it in GitHub Desktop.
Laravel Assignment

Laravel Assignment

Create the following routes, models, controllers

Model

People (schema)

  • first_name - string
  • last_name - string
  • age - integer
  • dept - string
  • is_active - boolean (default -0)

First create a migration php artisan make:migration create_peoples_table Define the people schema as mentioned above Next create a model php artisan make:model People Next create a controller for people php artisan make:controller PeopleController

Department (schema)

  • name - string
  • code - string
  • is_active - boolean (default -0)

First create a migration php artisan make:migration create_departments_table Define the department schema as mentioned above Next create a model php artisan make:model Department Next create a controller for people php artisan make:controller DepartmentController

Routes:

  • GET /people List the people in peoples tables as array

  • POST /people Add a new people into Peoples table

  • GET /department List the departments in department tables as array

  • POST /department Add a new department into departments table

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment