For creating table the SQL query is

  `id` int(11) NOT NULL  AUTO_INCREMENT,
  `name` varchar(30) NOT NULL,
  `email` varchar(30) NOT NULL,
  `password` varchar(30) NOT NULL,

Create Routes

routes/web.php : In next step, we will add new two routes in web.php file.

Route::get('/', function () {
    return view('registration');
Route::post('crud_insert', 'CrudController@save');

Creating The CrudController

Create a controller file CrudController.php and save it in the following path app/Http/Controllers/CrudController.php.


namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\CrudModel;

class CrudController extends Controller
    function save(Request $req){
        $data = new CrudModel;
        $data->name = $req->name;
        $data->email = $req->email;
        $data->password = $req->pwd;
        return back()
            ->with("status","Insert Successfully.");

Creating The CrudModel

Create a controller file CrudModel.php and save it in the following path app/CrudModel.php.


namespace App;

use Illuminate\Database\Eloquent\Model;

class CrudModel extends Model
    protected $table = 'demo';
    public $timestamps = false;

Creating The View

Create a view file registration.blade.php and save the below code it in resources/views/registration.blade.php.

<!DOCTYPE html>
<html lang="en">
  <title>Registration Form</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="">
  <script src=""></script>
  <script src=""></script>
  <script src=""></script>

<div class="container mt-5">
    <h1 class="text-center">Registration Form</h1>
   <form action="crud_insert" method="post">
    @if ($message = Session::get('status'))
    <div class="alert alert-success alert-block">
        <button type="button" class="close" data-dismiss="alert">×</button>
            <strong>{{ $message }}</strong>

    <label for="name" class="mb-2 mr-sm-2">Name:</label>
    <input type="text" class="form-control mb-2 mr-sm-2" id="name" placeholder="Enter name" name="name" >
    <label for="email2" class="mb-2 mr-sm-2">Email:</label>
    <input type="text" class="form-control mb-2 mr-sm-2" id="email2" placeholder="Enter email" name="email" >
    <label for="pwd2" class="mb-2 mr-sm-2">Password:</label>
    <input type="text" class="form-control mb-2 mr-sm-2" id="pwd2" placeholder="Enter password" name="pwd" >
    <input type="submit" class="btn btn-primary mb-2" value="Insert">


Let us execute this example by the following URL in the browser. This URL may be different based on your website.