CRUD App On Laravel

Laravel is a very robust php framework that is used to develop fully functional systems.

On Laravel reusability of code and functions is very simple and easy.

To Understand the Laravel PHP framework we must start from scratch and share on these posts.

Let’s start by creating a simple Laravel app and configuring it. To get more details about Laravel and how to create Laravel full documentation visit How to be Professional on Laravel and get detailed concepts on leaves.

To Create a Laravel project use the following

composer create-project --prefer-dist laravel/laravel laracrud

description of some details about the above command

  • composer -> package managers of the project
  • create-project -> It is a command that is used to download or clone the Laravel framework from hosted sites
  • –prefer-dist -> package we have to use it
  • laravel/laravel is the version of the Laravel framework
  • laracrud the name of our project

Change your directory to your project name

cd laracrud

Then open your project with code editors

Code Structure of Laravel applications folder.

Laravel has it own code structures and folders

App folder contains the main functions of the Laravel setups

It contains the following folders and files

  • Console
  • Exceptions
  • HTTP
  • Models
  • Providers

Lets start typing the codes.

Create View by using Blade Laravel template

To create blade template we must understand the following things.

All view files are stored in the resources folder

Create folder views/layouts on views.

In the layouts folder create the file master_layout.blade.php

<!doctype html>
<html lang="en">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
  <nav class="navbar navbar-expand-lg bg-body-tertiary">
  <div class="container-fluid">
    <a class="navbar-brand" href="#">Home</a>
    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav me-auto mb-2 mb-lg-0">
        <li class="nav-item">
          <a class="nav-link active" aria-current="page" href="#">Home</a>
        <li class="nav-item">
          <a class="nav-link" href="#">Link</a>
        <li class="nav-item dropdown">
          <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
          <ul class="dropdown-menu">
            <li><a class="dropdown-item" href="#">Action</a></li>
            <li><a class="dropdown-item" href="#">Another action</a></li>
            <li><hr class="dropdown-divider"></li>
            <li><a class="dropdown-item" href="#">Something else here</a></li>
    <script src="" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous">

The above code shows how to create blade files and include bootstrap on our projects.

How to Run Laravel Project by using terminals

php artisan serve

After typing the above command we get the following outputs.

INFO Server running on [].Press Ctrl+C to stop the server

How to Create Route?

To create route in Laravel we must go to the routes folder select web.php and add your routes to route list.. to get all the route list use the following command

php artisan route:list

use Illuminate\Support\Facades\Route;
| Web Routes
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "web" middleware group. Make something great!
Route::get('/', function () {
    return view('welcome');
    return view('layouts.master_layouts');

The above code shows how to create a route on Laravel setups

Route::get(‘home’,function(){} );

call the functions that render views of blade templates.

Author: bbnadmin

2 thoughts on “CRUD App On Laravel

  1. Hi there, i read your blog from time to time and i
    own a similar one and i was just wondering if you
    get a lot of spam remarks? If so how do you protect against it, any plugin or anything you can suggest?
    I get so much lately it’s driving me insane so any help is very much appreciated.

Leave a Reply

Your email address will not be published. Required fields are marked *