Laravel View With Json Value

View Json Value In laravel View :

Controller file :

  public function index()
    {
        //
        $students = Student::get()->toJson(JSON_PRETTY_PRINT);
         // return response($students, 200);
         return view('student.List')->with('students', json_decode($students,true));
    }

View File :

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
@foreach($students as $students)
    <tr class="odd pointer">
        <td class=" ">{{$students["id"]}}</td>
        <td class=" ">{{$students["name"]}}</td>
    </tr>
@endforeach
</body>
</html>

Laravel Rest Api Tester Package Tutorial

Step 1: Install laravel-api-tester Package

composer require asvae/laravel-api-tester

After successfully install package, you have to open config/app.php file and add service provider and alias.

config/app.php

'providers' => [

	....

	Asvae\ApiTester\ServiceProvider::class,

]

.....

You can publish the default configuration file by following command:

php artisan vendor:publish --provider="Asvae\ApiTester\ServiceProvider"

Step 2: Create API Route

Route::get('users',function(){	$users = \App\User::get();	return response()->json($users);});

Go This Link

http://localhost:8000/api-tester

Face Some Problem Work Some Step : Original link

here what i found after carefully reading core files of api-tester, and it works for me in laravel version > 5.8
you need to change some files in vendor\asvae\laravel-api-tester folder

Step 1:
first of all open vendor\asvae\laravel-api-tester\resources\views\api-tester.blade.php
and replace some code
From:
<link media="all" type="text/css" rel="stylesheet" href="{{ route('api-tester.file', ['file' => 'api-tester.css']) }}">
To:
<link media="all" type="text/css" rel="stylesheet" href="{{ route('api-tester.file', ['_file' => 'api-tester.css']) }}">

also need to do some more in same file:

From:
<script src="{{ route('api-tester.file', ['file' => 'api-tester.js']) }}"></script>
To:
<script src="{{ route('api-tester.file', ['_file' => 'api-tester.js']) }}"></script>

Step 2:
if you are not running your system on PHP v7.4 then skip the step 2
open vendor\asvae\laravel-api-tester\src\Storages folder and find JsonStorage.php
on line # 57 Replace the code

From:
$this->path = implode($path,'/');

To:
$this->path = implode('/',$path);

Step 3:

open vendor\asvae\laravel-api-tester\src\Entities folder and find RouteInfo.php
on line # 190 Replace the code

From:

if (is_string($uses) && str_contains($uses, '@')) {

To:
if (is_string($uses) && Str::contains($uses, '@')) {

also dont forget to add below line at top of the page
use Illuminate\Support\Str;
that's it Now enjoy with your output.

Laravel Tutorial List

CSS Snippet

Hero Section Link

Bootstrap Material Input :

<div class="row">
		<div class="col-md-3">
    	 <div class="pad15"><br>
                                <div class="md-input">
                                    <input class="md-form-control" required="" type="text">
                                    <span class="highlight"></span>
                                    <span class="bar"></span>
                                    <label>User Name</label>
                                </div>
                                <div class="md-input">
                                    <input class="md-form-control" required="" type="text">
                                    <span class="highlight"></span>
                                    <span class="bar"></span>
                                    <label>Password</label>
                                </div>
  
		</div>
    </div>


        <div class="col-md-3">
    	 <div class="pad15"><br>
                                <div class="md-input">
                                    <input class="md-form-control" required="" type="text">
                                    <span class="highlight"></span>
                                    <span class="bar"></span>
                                    <label>User Name</label>
                                </div>
                                <div class="md-input">
                                    <input class="md-form-control" required="" type="text">
                                    <span class="highlight"></span>
                                    <span class="bar"></span>
                                    <label>Password</label>
                                </div>
  
		</div>
    </div>
    
 
</div>   
.md-input {
    position: relative;
    margin-bottom: 30px;
}
    .md-input .md-form-control {
        font-size: 16px;
        padding: 10px 10px 10px 5px;
        display: block;
        border: none;
        border-bottom: 2px solid #CACACA;
        box-shadow: none;
        width: 100%;
    }

    .md-input label {
        color: rgba(0, 0, 0, 0.5);
        font-size: 16px;
        font-weight: normal;
        position: absolute;
        pointer-events: none;
        left: 5px;
        top: 10px;
        transition: 0.2s ease all;
        -moz-transition: 0.2s ease all;
        -webkit-transition: 0.2s ease all;
    }

    .md-input .bar:before {
        left: 50%;
    }

    .md-input .bar:after {
        right: 50%;
    }

    .md-input .highlight {
        position: absolute;
        height: 60%;
        width: 100px;
        top: 25%;
        left: 0;
        pointer-events: none;
        opacity: 0.5;
    }
    .md-input .md-form-control:focus ~ label, .md-input .md-form-control:valid ~ label {
    top: -15px;
    font-size: 14px;
    color: #183D5D;
}
.md-input .bar:before, .md-input .bar:after {
    content: '';
    height: 2px;
    width: 0;
    bottom: 0px;
    position: absolute;
    background: #03A9F4;
    transition: 0.2s ease all;
    -moz-transition: 0.2s ease all;
    -webkit-transition: 0.2s ease all;
}

.md-input .md-form-control:focus ~ .bar:before, .md-input .md-form-control:focus ~ .bar:after {
    width: 50%;
}

scrool load fade effect

$(window).on("load",function() {
  $(window).scroll(function() {
    var windowBottom = $(this).scrollTop() + $(this).innerHeight();
    $(".fade").each(function() {
      /* Check the location of each desired element */
      var objectBottom = $(this).offset().top + $(this).outerHeight();
      
      /* If the element is completely within bounds of the window, fade it in */
      if (objectBottom < windowBottom) { //object comes into view (scrolling down)
        if ($(this).css("opacity")==0) {$(this).fadeTo(500,1);}
      } else { //object goes out of view (scrolling up)
        if ($(this).css("opacity")==1) {$(this).fadeTo(500,0);}
      }
    });
  }).scroll(); //invoke scroll-handler on page-load
});
.fade {
  margin: 50px;
  padding: 50px;
  background-color: lightgreen;
  opacity: 1;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>

<div>
  <div class="fade">Fade In 01</div>
  <div class="fade">Fade In 02</div>
  <div class="fade">Fade In 03</div>
  <div class="fade">Fade In 04</div>
  <div class="fade">Fade In 05</div>
  <div class="fade">Fade In 06</div>
  <div class="fade">Fade In 07</div>
  <div class="fade">Fade In 08</div>
  <div class="fade">Fade In 09</div>
  <div class="fade">Fade In 10</div>
</div>

Bootstrap Admin Dashboard With Slide Menu

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->

<div id="throbber" style="display:none; min-height:120px;"></div>
<div id="noty-holder"></div>
<div id="wrapper">
    <!-- Navigation -->
    <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="https://bryanrojasq.wordpress.com">
                <img src="http://placehold.it/200x50&text=LOGO" alt="LOGO">
            </a>
        </div>
        <!-- Top Menu Items -->
        <ul class="nav navbar-right top-nav">
            <li><a href="#" data-placement="bottom" data-toggle="tooltip" href="#" data-original-title="Stats"><i class="fa fa-bar-chart-o"></i>
                </a>
            </li>            
            <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Admin User <b class="fa fa-angle-down"></b></a>
                <ul class="dropdown-menu">
                    <li><a href="#"><i class="fa fa-fw fa-user"></i> Edit Profile</a></li>
                    <li><a href="#"><i class="fa fa-fw fa-cog"></i> Change Password</a></li>
                    <li class="divider"></li>
                    <li><a href="#"><i class="fa fa-fw fa-power-off"></i> Logout</a></li>
                </ul>
            </li>
        </ul>
        <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
        <div class="collapse navbar-collapse navbar-ex1-collapse">
            <ul class="nav navbar-nav side-nav">
                <li>
                    <a href="#" data-toggle="collapse" data-target="#submenu-1"><i class="fa fa-fw fa-search"></i> MENU 1 <i class="fa fa-fw fa-angle-down pull-right"></i></a>
                    <ul id="submenu-1" class="collapse">
                        <li><a href="#"><i class="fa fa-angle-double-right"></i> SUBMENU 1.1</a></li>
                        <li><a href="#"><i class="fa fa-angle-double-right"></i> SUBMENU 1.2</a></li>
                        <li><a href="#"><i class="fa fa-angle-double-right"></i> SUBMENU 1.3</a></li>
                    </ul>
                </li>
                <li>
                    <a href="#" data-toggle="collapse" data-target="#submenu-2"><i class="fa fa-fw fa-star"></i>  MENU 2 <i class="fa fa-fw fa-angle-down pull-right"></i></a>
                    <ul id="submenu-2" class="collapse">
                        <li><a href="#"><i class="fa fa-angle-double-right"></i> SUBMENU 2.1</a></li>
                        <li><a href="#"><i class="fa fa-angle-double-right"></i> SUBMENU 2.2</a></li>
                        <li><a href="#"><i class="fa fa-angle-double-right"></i> SUBMENU 2.3</a></li>
                    </ul>
                </li>
                <li>
                    <a href="investigaciones/favoritas"><i class="fa fa-fw fa-user-plus"></i>  MENU 3</a>
                </li>
                <li>
                    <a href="sugerencias"><i class="fa fa-fw fa-paper-plane-o"></i> MENU 4</a>
                </li>
                <li>
                    <a href="faq"><i class="fa fa-fw fa fa-question-circle"></i> MENU 5</a>
                </li>
            </ul>
        </div>
        <!-- /.navbar-collapse -->
    </nav>

    <div id="page-wrapper">
        <div class="container-fluid">
            <!-- Page Heading -->
            <div class="row" id="main" >
                <div class="col-sm-12 col-md-12 well" id="content">
                    <h1>Welcome Admin!</h1>
                </div>
            </div>
            <!-- /.row -->
        </div>
        <!-- /.container-fluid -->
    </div>
    <!-- /#page-wrapper -->
</div><!-- /#wrapper -->
@import url('https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css');
@media(min-width:768px) {
    body {
        margin-top: 50px;
    }
    /*html, body, #wrapper, #page-wrapper {height: 100%; overflow: hidden;}*/
}

#wrapper {
    padding-left: 0;    
}

#page-wrapper {
    width: 100%;        
    padding: 0;
    background-color: #fff;
}

@media(min-width:768px) {
    #wrapper {
        padding-left: 225px;
    }

    #page-wrapper {
        padding: 22px 10px;
    }
}

/* Top Navigation */

.top-nav {
    padding: 0 15px;
}

.top-nav>li {
    display: inline-block;
    float: left;
}

.top-nav>li>a {
    padding-top: 20px;
    padding-bottom: 20px;
    line-height: 20px;
    color: #fff;
}

.top-nav>li>a:hover,
.top-nav>li>a:focus,
.top-nav>.open>a,
.top-nav>.open>a:hover,
.top-nav>.open>a:focus {
    color: #fff;
    background-color: #1a242f;
}

.top-nav>.open>.dropdown-menu {
    float: left;
    position: absolute;
    margin-top: 0;
    /*border: 1px solid rgba(0,0,0,.15);*/
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    background-color: #fff;
    -webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175);
    box-shadow: 0 6px 12px rgba(0,0,0,.175);
}

.top-nav>.open>.dropdown-menu>li>a {
    white-space: normal;
}

/* Side Navigation */

@media(min-width:768px) {
    .side-nav {
        position: fixed;
        top: 60px;
        left: 225px;
        width: 225px;
        margin-left: -225px;
        border: none;
        border-radius: 0;
        border-top: 1px rgba(0,0,0,.5) solid;
        overflow-y: auto;
        background-color: #222;
        /*background-color: #5A6B7D;*/
        bottom: 0;
        overflow-x: hidden;
        padding-bottom: 40px;
    }

    .side-nav>li>a {
        width: 225px;
        border-bottom: 1px rgba(0,0,0,.3) solid;
    }

    .side-nav li a:hover,
    .side-nav li a:focus {
        outline: none;
        background-color: #1a242f !important;
    }
}

.side-nav>li>ul {
    padding: 0;
    border-bottom: 1px rgba(0,0,0,.3) solid;
}

.side-nav>li>ul>li>a {
    display: block;
    padding: 10px 15px 10px 38px;
    text-decoration: none;
    /*color: #999;*/
    color: #fff;    
}

.side-nav>li>ul>li>a:hover {
    color: #fff;
}

.navbar .nav > li > a > .label {
  -webkit-border-radius: 50%;
  -moz-border-radius: 50%;
  border-radius: 50%;
  position: absolute;
  top: 14px;
  right: 6px;
  font-size: 10px;
  font-weight: normal;
  min-width: 15px;
  min-height: 15px;
  line-height: 1.0em;
  text-align: center;
  padding: 2px;
}

.navbar .nav > li > a:hover > .label {
  top: 10px;
}

.navbar-brand {
    padding: 5px 15px;
}
$(function(){
    $('[data-toggle="tooltip"]').tooltip();
    $(".side-nav .collapse").on("hide.bs.collapse", function() {                   
        $(this).prev().find(".fa").eq(1).removeClass("fa-angle-right").addClass("fa-angle-down");
    });
    $('.side-nav .collapse').on("show.bs.collapse", function() {                        
        $(this).prev().find(".fa").eq(1).removeClass("fa-angle-down").addClass("fa-angle-right");        
    });
})    
    

Laravel Solution

Create Laravel Project

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

Database Connection : Open .enf File And Edit

DB_CONNECTION=mysql 
 DB_HOST=127.0.0.1 
 DB_PORT=3306 
 DB_DATABASE=here your database name here
 DB_USERNAME=here database username here
 DB_PASSWORD=here database password here

Create Migration File : open Cmd In Project Folder And Run Script

php artisan make:migration migrationfilename

Create Database Table And Column With Migration File : open migration File And edit with tablename

public function up()
 {
     Schema::create('tablename', function (Blueprint $table) {
         $table->increments('id');
         $table->string('name')->nullable();
         $table->string('email')->nullable();
         $table->timestamps();
     });
 }

Migration Comand:

php artisan migrate

Migration Rules :

<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateOITMSTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('o_i_t_m_s', function (Blueprint $table) {
            $table->id();
            $table->engine = 'InnoDB';
            $table->boolean('is_publish')->default(0);
            $table->charset = 'utf8mb4';
            $table->string('ItemCode',50)->comment('Item No.');
            $table->string('CodeBars',254)->comment('Bar Code');
            $table->mediumText('ItemName',100)->comment('Item Description');
            $table->string('FrgnName',100)->comment('Foreign Name')->nullable();
            $table->bigInteger('ItmsGrpCod',6)->comment('Item Group');
            $table->string('ItemType',50)->comment('Item Type');
            $table->char('VATLiable',1)->comment('Tax Liable');
            $table->date('created_date')->comment('Created Date');
            $table->dateTime('created_time', 10)->comment('Created Time');
            $table->decimal('unit_price', 8, 2)->comment('Unit Price');
            $table->enum('status', ['Pending', 'Wait', 'Active'])->default('Pending');
            $table->longText('remarks')->comment('Item Remarks')->default("");
            $table->smallInteger('qty',12)->comment('Quantity');
            $table->macAddress('device')->comment('Device Macaddress');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('o_i_t_m_s');
    }
}

Solve Migration Error for Default String Length :app/providers/AppServiceProvider.php and put the below code :

use Illuminate\Support\Facades\Schema;
 

function boot()
{
    Schema::defaultStringLength(191);
}

Create Resource Route : Include In Route/Web.php

Route::resource('ajax-crud', 'AjaxController');

Make Controller: Open Cmd In Project Folder And Run Script

php artisan make:controller ControllerName --resource 

Laravel start development Server with ip and port :

php artisan serve --host 192.168.1.101 --port 80

Store Data

  public function store(Request $request)
    {
        //
        $validatedData = $request->validate([
            'name'=>'required|max:255',
            'roll'=>'required',
            'class'=>'required'
        ]);
        $show = Student::create($validatedData);
        return redirect('/student')->with('successs','Student Added');
    }

Get Data And View Data

Get All Data :

   public function index()
    {
        //
 
        $data = Student::all();
        return view('student.index',compact('data'));
    }
 

Get All Data And View with Paginate By Controller And View :

    public function index()
    {
        $data['users'] = User::orderBy('id','desc')->paginate(8);
   
        return view('ajax-crud',$data);
    }
    <table class="table table-bordered" id="laravel_crud">
           <thead>
              <tr>
                 <th>Id</th>
                 <th>Name</th>
                 <th>Email</th>
                 <td colspan="2">Action</td>
              </tr>
           </thead>
           <tbody id="users-crud">
              @foreach($users as $u_info)
              <tr id="user_id_{{ $u_info->id }}">
                 <td>{{ $u_info->id  }}</td>
                 <td>{{ $u_info->name }}</td>
                 <td>{{ $u_info->email }}</td>
                 <td colspan="2">
                    <a href="javascript:void(0)" id="edit-user" data-id="{{ $u_info->id }}" class="btn btn-info mr-2">Edit</a>
                    <a href="javascript:void(0)" id="delete-user" data-id="{{ $u_info->id }}" class="btn btn-danger delete-user">Delete</a>
                  </td>
              </tr>
              @endforeach
           </tbody>
          </table>
          {{ $users->links() }}

Find With Coloumn Name :

  public function edit($id)
    {   
        $where = array('id' => $id);
        $user  = User::where($where)->first();
 
        return Response::json($user);
    }
 

Another Way :

 public function edit($id)
    {
        //
        $studentedit = Student::findOrFail($id);
        return view('student.edit')->with('data',$studentedit);
    }

Multiple Json Array Controller

return Response::json(array(
    'item_image' => $item_image,
    'item_something' => $item_something,
    'item_more' => $item_more,
));

Jquery Ajax With Laravel :

Ajax csrf tocken Handle :

   // ADD HEAD SECTION 
 <meta name="csrf-token" content="{{ csrf_token() }}">
$.ajaxSetup({
        headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        }
    });

Add bootstrap Flash Message

  • Adding Bootstrap css And Jquery.js
  • return Session Message In Controller
 return redirect('employee')->with('success', 'Data Added successfully.');

Print Session Message In View

  <!-- For Flash Meaasge -->
    <div id="message">
        <div style="padding: 5px;">
            @if ($message = Session::get('success'))
            <div class="alert alert-success alert-block sticky-top alert alert-dismissible ">
                <button type="button" class="close" data-dismiss="alert">×</button>	
                    <strong>{{ $message }}</strong>
            </div>
            @endif
            
            
            @if ($message = Session::get('error'))
            <div class="alert alert-danger alert-block sticky-top alert alert-dismissible">
                <button type="button" class="close" data-dismiss="alert">×</button>	
                    <strong>{{ $message }}</strong>
            </div>
            @endif
            
            
            @if ($message = Session::get('warning'))
            <div class="alert alert-warning alert-block sticky-top alert alert-dismissible">
                <button type="button" class="close" data-dismiss="alert">×</button>	
                <strong>{{ $message }}</strong>
            </div>
            @endif
            
            
            @if ($message = Session::get('info'))
            <div class="alert alert-info alert-block sticky-top alert alert-dismissible">
                <button type="button" class="close" data-dismiss="alert">×</button>	
                <strong>{{ $message }}</strong>
            </div>
            @endif
            
            
            @if ($errors->any())
            <div class="alert alert-danger sticky-top alert alert-dismissible">
                <button type="button" class="close" data-dismiss="alert">×</button>	
                Please check the form below for errors
            </div>
            @endif
        </div>
    </div>


  <!-- For Flash Meaasge End -->

Route With Link

In addition to @chanafdo answer, you can use route name

when working with laravel blade

<a href="{{route('login')}}">login here</a>
with parameter in route name

when go to url like URI: profile/{id} 
<a href="{{route('profile', ['id' => 1])}}">login here</a>

without blade

<a href="<?php echo route('login')?>">login here</a>

with parameter in route name

when go to url like URI: profile/{id} 
<a href="<?php echo route('profile', ['id' => 1])?>">login here</a>

Session Set And Get

 // controller file        
Session::put('success', $validate);
// view file
{{ Session::get('success') }}

Laravel Searching Eloquent models

    $data =   Student::query()
        ->where('name', 'LIKE', "%{$id}%") 
        ->orWhere('roll', 'LIKE', "%{$id}%") 
        ->get();

   return Response::json($data);

Integrated Admin Lte Te

follow Link

āĻāĻ•āϟāĻž āĻāĻ•āϟāĻž āĻ•āϰ⧇ āĻ•āĻŽā§āĻĒā§‹āϜāĻžāϰ āĻ¸ā§āĻ•ā§āϰāĻŋāĻĒā§āϟ āϰāĻžāύ āĻ•āϰāĻŋ

composer require jeroennoten/laravel-adminlte

composer require laravel/ui

php artisan ui:controllers
php artisan adminlte:install
composer update jeroennoten/laravel-adminlte
php artisan adminlte:update
php artisan adminlte:install --only=main_views

āĻāĻŦāĻžāϰ resources/views/vendor/adminlte āĻĢā§‹āĻ˛ā§āĻĄāĻžāϰ āĻĻ⧇āĻ–āϤ⧇ āĻĒāĻžāĻŦā§‹

home.blade āĻŸā§‡āĻŽā§āĻĒāϞ⧇āϟ āĻĢāĻžāχāϞ āĻāĻĄāĻŋāϟ āĻ•āϰāĻŋ

{{-- resources/views/admin/dashboard.blade.php --}}

@extends('adminlte::page')

@section('title', 'Dashboard')

@section('content_header')
    <h1>Dashboard</h1>
@stop

@section('content')
    <p>Welcome to this beautiful admin panel.</p>
@stop

@section('css')
    <link rel="stylesheet" href="/css/admin_custom.css">
@stop

@section('js')
    <script> console.log('Hi!'); </script>
@stop

Change Menu Item : Open projectfolder/config/adminlte.php and Edit

āĻšā§‹āĻŽ āĻĒ⧇āϜ āĻ āϗ⧇āϞ⧇ āϞāĻ—āχāύ āĻĒ⧇āϜ āĻļā§‹ āĻ•āϰāĻžāύ⧋ : copy C:\xampp\htdocs\laravel8\resources\views\vendor\adminlte\auth\login.blade.php

and past

welcome.blade.php

Change Laravel Public Dorectory :

FOLLOW LINK

  • cut index.php and httaccs file and past in project root directory

Open index.php and replace 

require __DIR__.'/../vendor/autoload.php';
 TO 
require __DIR__.'/vendor/autoload.php';

$app = require_once __DIR__.'/../bootstrap/app.php';
TO 
$app = require_once __DIR__.'/bootstrap/app.php';

Save and close the file. Go to your browser and reload your page. Now, you should see the Laravel’s welcome page.

āϞāĻžāϰāĻžāϭ⧇āϞ āĻ āĻ­āĻŋāω āĻĄāĻŋāϜāĻžāχāύ āĻ āĻĻāϰāĻ•āĻžāϰāĻŋ āĻĢāĻžāύāσāĻļāύ :

<!-- CSRF Token -->
    <meta name="csrf-token" content="{{ csrf_token() }}">

<!-- Get App Name And Show 
set config/app.php
'name' => 'Laravel',
And also inside .env file
APP_NAME=your_app_name

<title>Invoice - {{ config('app.name', 'Inventory Management System') }}</title>

// Show Date with Formate 
Date: {{ date('l, d-M-Y h:i:s A') }}

//Show Price With Format
{{ number_format($content->price, 2) }}


Zkteco Time Attendance System With Zkteco Machine

āĻĒā§āϰāĻĨāĻŽā§‡ zkteco āĻ…ā§āϝāĻžāĻŸā§‡āύāĻĄā§‡āĻ¨ā§āϏ āĻŽā§‡āĻļāĻŋāύ āϕ⧇ āχāĻ¨ā§āϟāĻžāϰāύ⧇āϟ āĻ•ā§āϝāĻžāĻŦāϞ āĻĻā§āĻŦāĻžāϰāĻž āĻ•āĻžāύ⧇āĻ•ā§āϟ āĻ•āϰāϤ⧇ āĻšāĻŦ⧇āĨ¤ āĻŽā§‡āĻļāĻŋāύ āĻāϰ āĻŽāĻ§ā§āϝ⧇ āφāχāĻĒāĻŋ āĻ āĻŋāĻ• āĻ•āϰāĻžāϰ āĻĒāϰ āφāχāĻĒāĻŋ āϟāĻŋ āĻĒāϰāĻŦāĻ°ā§āϤ⧀āϤ⧇ āϏāĻĢāϟāĻ“ā§Ÿā§āϝāĻžāϰ āĻāϰ āϏāĻžāĻĨ⧇ āĻ•āĻžāύ⧇āĻ•ā§āϟ āĻ•āϰāĻžāϰ āϜāĻ¨ā§āϝ āĻĻāϰāĻ•āĻžāϰ āĻšāĻŦ⧇āĨ¤
ā§§. zkteco attendance management āϏāĻĢāϟāĻ“ā§Ÿā§āϝāĻžāϰ āĻ•āĻŽā§āĻĒāĻŋāωāϟāĻžāϰ āĻ āϏāĻžāϧāĻžāϰāĻŖ āύāĻŋ⧟āĻŽā§‡ āχāύāĻ¸ā§āϟāϞ āĻ•āϰāϤ⧇ āĻšāĻŦ⧇āĨ¤
⧍. āϏāĻĢāϟāĻ“ā§Ÿā§āϝāĻžāϰ āĻ“āĻĒ⧇āύ āĻ•āϰ⧇ āĻĄāĻŋāĻ­āĻžāχāϏ āĻ…ā§āϝāĻžāĻĄ āĻ•āϰ⧇ āĻ•āύāĻĢāĻŋāĻ—āĻžāϰ āĻ•āϰ⧇ āĻ•āĻžāύ⧇āĻ•ā§āϟ āĻ•āϰāϤ⧇ āĻšāĻŦ⧇āĨ¤

āĻ•āĻŋāĻ­āĻžāĻŦ⧇ āĻŽā§‡āĻļāĻŋāύ āĻšāϤ⧇ āĻ…ā§āϝāĻžāĻŸā§‡āύāĻĄā§‡āĻ¨ā§āϏ āĻĄāĻžāϟāĻž āφāύāĻŦā§‹ : āϏāĻĢāϟāĻ“ā§Ÿā§āϝāĻžāϰ āĻ“āĻĒ⧇āύ āĻ•āϰ⧇ āĻŦāĻžāĻŽāĻĒāĻžāĻļ⧇āϰ āĻŽā§‡āύ⧁ āĻšāϤ⧇ download attendance log āĻ•ā§āϞāĻŋāĻ• āĻ•āϰāϞ⧇ āĻŽā§‡āĻļāĻŋāύ āĻāϰ āĻ…ā§āϝāĻžāĻŸā§‡āύāĻĄā§‡āĻ¨ā§āϏ āχāύ āφāωāϟ āĻĄāĻžāϟāĻž āĻŽā§‡āĻļāĻŋāύ āĻšāϤ⧇ āϏāĻĢāϟāĻ“ā§Ÿā§āϝāĻžāϰ āĻ āϚāϞ⧇ āφāϏāĻŦ⧇āĨ¤

āĻ•āĻŋāĻ­āĻžāĻŦ⧇ āĻŽā§‡āĻļāĻŋāύ āĻšāϤ⧇ āχāωāϜāĻžāϰ āĻĄāĻžāϟāĻž āφāύāĻŦā§‹ :āϏāĻĢāϟāĻ“ā§Ÿā§āϝāĻžāϰ āĻ“āĻĒ⧇āύ āĻ•āϰ⧇ āĻŦāĻžāĻŽāĻĒāĻžāĻļ⧇āϰ āĻŽā§‡āύ⧁ āĻšāϤ⧇ download userinfo and Fp āĻ•ā§āϞāĻŋāĻ• āĻ•āϰāϞ⧇ āĻŽā§‡āĻļāĻŋāύ āĻāϰ āχāωāϜāĻžāϰ āĻĄāĻžāϟāĻž āĻŽā§‡āĻļāĻŋāύ āĻšāϤ⧇ āϏāĻĢāϟāĻ“ā§Ÿā§āϝāĻžāϰ āĻ āϚāϞ⧇ āφāϏāĻŦ⧇āĨ¤

āĻ•āĻŋāĻ­āĻžāĻŦ⧇ āĻŽā§‡āĻļāĻŋāύ āĻ āĻŽā§āϝāĻžāύ⧁⧟āĻžāϞāĻŋ āχāωāϜāĻžāϰ āĻāϰ āύāĻžāĻŽ āĻ“ āĻ…āĻ¨ā§āϝ āϤāĻĨā§āϝ āφāĻĒāĻĄā§‡āϟ āĻ•āϰāĻŦā§‹ : āϏāĻĢāϟāĻ“ā§Ÿā§āϝāĻžāϰ āĻ“āĻĒ⧇āύ āĻ•āϰ⧇ āωāĻĒāϰ⧇āϰ employee āĻ•ā§āϞāĻŋāĻ• āĻ•āϰ⧇ āχāωāϜāĻžāϰ āϏāĻŋāϞ⧇āĻ•ā§āϟ āĻ•āϰ⧇ āĻĄāĻžāϟāĻž āĻāĻĄāĻŋāϟ āĻ•āϰ⧇ āϏ⧇āĻ­ āĻŦāĻžāϟāύ⧇ āĻ•ā§āϞāĻŋāĻ• āĻ•āϰāϤ⧇ āĻšāĻŦ⧇āĨ¤

āφāĻĒāĻĄā§‡āϟāĻ•ā§ƒāϤ āχāωāϜāĻžāϰ āχāύāĻĢāϰāĻŽā§‡āĻļāύ āϏāĻĢāϟāĻ“ā§Ÿā§āϝāĻžāϰ āĻšāϤ⧇ āĻŽā§‡āĻļāĻŋāύ āĻ āĻĒāĻžāĻ āĻžāύ⧋ : āϏāĻĢāϟāĻ“ā§Ÿā§āϝāĻžāϰ āĻ āχāωāϜāĻžāϰ āχāύāĻĢāϰāĻŽā§‡āĻļāύ āφāĻĒāĻĄā§‡āϟ āĻ•āϰāĻžāϰ āĻĒāϰ āĻŦāĻžāĻŽāĻĒāĻžāĻļ⧇āϰ āĻŽā§‡āύ⧁ āĻšāϤ⧇ upload userinfo and fp āĻ•ā§āϞāĻŋāĻ• āĻ•āϰ⧇ āχāωāϜāĻžāϰ āϏāĻŦ āĻŦāĻž āχāĻšā§āĻ›āĻžāĻŽāϤ⧋ āϏāĻŋāϞ⧇āĻ•ā§āϟ āĻ•āϰ⧇ āφāĻĒāϞ⧋āĻĄ āĻŦāĻžāϟāύ⧇ āĻ āĻ•ā§āϞāĻŋāĻ• āĻ•āϰāϞ⧇ āϏāĻĢāϟāĻ“ā§Ÿā§āϝāĻžāϰ āĻšāϤ⧇ āĻŽā§‡āĻļāĻŋāύ āĻ āĻĄāĻžāϟāĻž āϚāϞ⧇ āϝāĻžāĻŦ⧇āĨ¤

āϏāĻĢāϟāĻ“ā§Ÿā§āϝāĻžāϰ āĻ āĻĄāĻŋāĻĒāĻžāĻ°ā§āϟāĻŽā§‡āĻ¨ā§āϟ āĻ…ā§āϝāĻžāĻĄ āĻ•āϰāĻž : āĻŦāĻžāĻŽāĻĒāĻžāĻļ⧇āϰ āĻŽā§‡āύ⧁ āĻšāϤ⧇ department list āĻ•ā§āϞāĻŋāĻ• āĻ•āϰ⧇ āĻ…ā§āϝāĻžāĻĄ āĻŦāĻžāϟāύ⧇ āĻ āĻ•ā§āϞāĻŋāĻ• āĻ•āϰ⧇ āĻĄāĻŋāĻĒāĻžāĻ°ā§āϟāĻŽā§‡āĻ¨ā§āϟ āĻ…ā§āϝāĻžāĻĄ āĻ•āϰāϤ⧇ āĻšāĻŦ⧇āĨ¤

āϏāĻĢāϟāĻ“ā§Ÿā§āϝāĻžāϰ āĻ āχāωāϜāĻžāϰāĻĻ⧇āϰ āĻŦāĻŋāĻ­āĻŋāĻ¨ā§āύ āĻĄāĻŋāĻĒāĻžāĻ°ā§āϟāĻŽā§‡āĻ¨ā§āϟ āĻ āĻ…ā§āϝāĻžāĻĄ āĻ•āϰāĻž : āĻĒā§āϰāĻĨāĻŽā§‡ āϏāĻĢāϟāĻ“ā§Ÿā§āϝāĻžāϰ āĻ“āĻĒ⧇āύ āĻ•āϰ⧇ employee āĻŽā§‡āύ⧁ āĻ•ā§āϞāĻŋāĻ• āĻ•āϰ⧇ āχāωāϜāĻžāϰ āϏāĻŋāϞ⧇āĻ•ā§āϟ āĻ•āϰ⧇ transfer āĻāĻŽāĻĒā§āĻ˛ā§Ÿā§€ āĻ•ā§āϞāĻŋāĻ• āĻ•āϰ⧇ āĻĄāĻŋāĻĒāĻžāĻ°ā§āϟāĻŽā§‡āĻ¨ā§āϟ āϏāĻŋāϞ⧇āĻ•ā§āϟ āĻ•āϰ⧇ āĻ“āϕ⧇ āĻ•āϰāϞ⧇ employee āĻĄāĻŋāĻĒāĻžāĻ°ā§āϟāĻŽā§‡āĻ¨ā§āϟ āĻ āĻŸā§āϰāĻžāĻ¨ā§āϏāĻĢāĻžāϰ āĻšā§Ÿā§‡ āϝāĻžāĻŦ⧇

āϏāĻĢāϟāĻ“ā§Ÿā§āϝāĻžāϰ āĻāϰ āĻŽāĻžāĻĻā§āϧāĻŽā§‡ shift āĻŽā§āϝāĻžāύ⧇āϜāĻŽā§‡āĻ¨ā§āϟ āĻ•āϰāĻž : āĻĒā§āϰāĻĨāĻŽā§‡ āφāĻŽāĻžāĻĻ⧇āϰ Maintenence Time Table āĻ āĻ•ā§āϞāĻŋāĻ• āĻ•āϰ⧇ āφāĻŽāĻžāĻĻ⧇āϰ āĻļāĻŋāĻĢāϟ āϤ⧈āϰ⧀ āĻ•āϰāϤ⧇ āĻšāĻŦ⧇āĨ¤ āĻāĻŦāĻžāϰ shift management āĻ āĻ•ā§āϞāĻŋāĻ• āĻ•āϰ⧇ āĻļāĻŋāĻĢāϟ āĻāϰ āύāĻžāĻŽ āϤ⧈āϰ⧀ āĻ•āϰ⧇ āĻ…ā§āϝāĻžāĻĄ āĻŦāĻžāϟāύ⧇ āĻ•ā§āϞāĻŋāĻ• āĻ•āϰ⧇ āφāϗ⧇āϰ āĻŦāĻžāύāĻžāύ⧋ timetable āϏāĻŋāϞ⧇āĻ•ā§āϟ āĻ•āϰ⧇ āĻļāĻŋāĻĢāϟ āĻŦāĻžāύāĻžāϤ⧇ āĻšāĻŦ⧇āĨ¤

Employee āϕ⧇ āĻļāĻŋāĻĢāϟ āĻāϰ āĻ…āĻ¨ā§āϤāĻ°ā§āϭ⧁āĻ•ā§āϤ āĻ•āϰāĻž : Employee Schedule āĻ āĻ•ā§āϞāĻŋāĻ• āĻ•āϰ⧇ āĻāĻŽāĻĒā§āĻ˛ā§Ÿā§€ āϏāĻŋāϞ⧇āĻ•ā§āϟ āĻ•āϰ⧇ āύāĻŋāĻšā§‡āϰ time āϰ⧇āĻžā§āϜ āϏāĻŋāϞ⧇āĻ•ā§āϟ āĻ•āϰ⧇ āωāĻĒāϰ⧇āϰ arrange āĻļāĻŋāĻĢāϟ āĻ āĻ•ā§āϞāĻŋāĻ• āĻ•āϰ⧇ + āĻŦāĻž – āĻŦāĻžāϟāύ⧇ āĻ•ā§āϞāĻŋāĻ• āĻ•āϰ⧇ āĻļāĻŋāĻĢāϟ āĻ…ā§āϝāĻžāĻĄ āĻŦāĻž āϕ⧇āĻŸā§‡ āĻ“āϕ⧇ āĻ•āϰāϞ⧇ āĻļāĻŋāĻĢāϟ āĻāĻĒāϞāĻžāχ āĻšā§Ÿā§‡ āϝāĻžāĻŦ⧇āĨ¤

āĻ•āĻŋāĻ­āĻžāĻŦ⧇ holiday āϞāĻŋāĻ¸ā§āϟ āĻ…ā§āϝāĻžāĻĄ āĻŦāĻž āĻŽāĻžāχāύāĻžāϏ āĻ•āϰāĻŦā§‹ : āĻĒā§āϰāĻĨāĻŽā§‡ āωāĻĒāϰ⧇āϰ maintanence āĻ…āĻĒāϏāύ āĻšāϤ⧇ leave class āĻ āĻ•ā§āϞāĻŋāĻ• āĻ•āϰ⧇ āĻšāϞāĻŋāĻĄā§‡ āϞāĻŋāĻ¸ā§āϟ āϝ⧇āĻŽāύ āĻŽā§‡ āĻĄā§‡ ,āψāĻĻ āĻšāϞāĻŋāĻĄā§‡ ,Sick āϞāĻŋāĻ­ , āĻ•ā§āϝāĻžāϜ⧁⧟āĻžāϞ Leave āχāĻ¤ā§āϝāĻžāĻĻāĻŋ āϝ⧋āĻ— āĻŦāĻž āĻŦāĻŋā§Ÿā§‹āĻ— āĻ•āϰāĻŦā§‹āĨ¤

āĻ•āĻŋāĻ­āĻžāĻŦ⧇ Employee āĻĻ⧇āϰ āϏāĻĢāϟāĻ“ā§Ÿā§āϝāĻžāϰ āĻ āϛ⧁āϟāĻŋ āĻĻ⧇āĻŦ : attendance āĻŽā§‡āύ⧁ āĻšāϤ⧇ Employee leaving on business āĻ āĻ•ā§āϞāĻŋāĻ• āĻ•āϰ⧇ employee āϏāĻŋāϞ⧇āĻ•ā§āϟ āĻ•āϰ⧇ add āĻŦāĻžāϟāύ⧇ āĻ•ā§āϞāĻŋāĻ• āĻĄā§‡āϟ āϰ⧇āĻžā§āϜ āϏāĻŋāϞ⧇āĻ•ā§āϟ āĻ•āϰ⧇ āĻ“āϕ⧇ āĻ•āϰāϞ⧇ āϛ⧁āϟāĻŋ āĻĒā§āϰāϝ⧋āĻœā§āϝ āĻšāĻŦ⧇ āĨ¤

āĻ•āĻŋāĻ­āĻžāĻŦ⧇ Employee āĻĻ⧇āϰ āĻ•āĻžāϟāĻžāύ⧋ āϛ⧁āϟāĻŋ āϏāĻĢāϟāĻ“ā§Ÿā§āϝāĻžāϰ āĻ āĻĻ⧇āĻ–āĻŦā§‹ : attendance āĻŽā§‡āύ⧁ āĻšāϤ⧇ Employee leaving on business āĻ āĻ•ā§āϞāĻŋāĻ• āĻ•āϰ⧇ employee āϏāĻŋāϞ⧇āĻ•ā§āϟ āĻ•āϰ⧇ āĻĄā§‡āϟ āϰ⧇āĻžā§āϜ āϏāĻŋāϞ⧇āĻ•ā§āϟ āĻ•āϰ⧇ query āĻŦāĻžāϟāύ⧇ āĻ•ā§āϞāĻŋāĻ• āĻ•āϰāϞ⧇ āϛ⧁āϟāĻŋ āĻĻ⧇āĻ–āĻžāĻŦ⧇āĨ¤

āĻ•āĻŋāĻ­āĻžāĻŦ⧇ āĻāĻŽāĻĒā§āĻ˛ā§Ÿā§€ āĻĻ⧇āϰ āĻŽā§āϝāĻžāύ⧁⧟āĻžāϞāĻŋ āχāύ āφāωāϟ āĻ āĻŋāĻ• āĻ•āϰāĻŦā§‹ : āϏāĻĢāϟāĻ“ā§Ÿā§āϝāĻžāϰ āĻ“āĻĒ⧇āύ āĻ•āϰ⧇ attendance->forgoten to in out āĻ āĻ•ā§āϞāĻŋāĻ• āĻ•āϰ⧇ employee āϏāĻŋāϞ⧇āĻ•ā§āϟ āĻ•āϰ⧇ state āĻ in āĻ“ āφāωāϟ āϏāĻŋāϞ⧇āĻ•ā§āϟ āĻ•āϰ⧇ āĻĄā§‡āϟ āĻ“ āϟāĻžāχāĻŽ select āĻ•āϰ⧇ add āĻ•ā§āϞāĻŋāĻ• āĻ•āϰāϞ⧇ āĻĄāĻžāϟāĻž āχāύ āĻ“ āφāωāϟ āĻ āĻŋāĻ• āĻšā§Ÿā§‡ āϝāĻžāĻŦ⧇āĨ¤

Laravel Multiple Input Array Crud

Another Tutorials LINK

Index.blade.php

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link href="https://fonts.googleapis.com/css?family=Nunito:200,600" rel="stylesheet">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<style>

</style>
</head>
<body>
    <form action="/salesorder" method="post">
        @csrf
    

<div class="container">
    <div class="panel panel-default" style="background-color: #CCC">
        <div class="panel-body">
                <div class="col-sm-6"> <!-- FIRST COLUMN -->
            <!--------------------------------- Customer Code -------------------------------------------->
            <div class="form-group">
                <label for="" class="col-sm-4 control-label">Customer</label>
                <div class="col-sm-8">
                <input type="text" class="form-control" id="" name="CardCode"  placeholder="">
                </div>
            </div>
    
            <!--------------------------------- Customer Name -------------------------------------------->
            <div class="form-group">
                <label for="" class="col-sm-4 control-label"> Name</label>
                <div class="col-sm-8">
                <input type="text" class="form-control" id="" name="CardName" placeholder="">
                </div>
            </div>
            
                </div>
                <div class="col-sm-6"> <!-- Second COLUMN -->
                    <div class="form-group">
                        <label for="" class="col-sm-4 control-label"> Contact Person</label>
                        <div class="col-sm-8">
                        <input type="text" class="form-control" id="" name="CntctCode" placeholder="">
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="" class="col-sm-4 control-label"> Pi No</label>
                        <div class="col-sm-8">
                        <input type="text" class="form-control" id="" name="NumAtCard" placeholder="">
                        </div>
                    </div>
                </div>

                <div class="col-sm-6"> <!-- Third COLUMN -->
                    <div class="form-group">
                        <label for="" class="col-sm-4 control-label"> Currency</label>
                        <div class="col-sm-8">
                        <input type="text" class="form-control" id="" name="DocCur" placeholder="">

                    </div>
                    </div>

                    <div class="form-group">
                        <label for="" class="col-sm-4 control-label">Series </label>
                        <div class="col-sm-8">
                        <input type="text" class="form-control" id="" name="Series" placeholder="">
                        </div>
                    </div>
                </div>

                <div class="col-sm-6"> <!-- Four COLUMN -->
                    <div class="form-group">
                        <label for="" class="col-sm-4 control-label"> So </label>
                        <div class="col-sm-8">
                        <input type="text" class="form-control" id="" name="DocNum" placeholder="">

                    </div>
                    </div>

                    <div class="form-group">
                        <label for="" class="col-sm-4 control-label">Date </label>
                        <div class="col-sm-8">
                        <input type="text" class="form-control" id="" name="DocDueDate" placeholder="">
                        </div>
                    </div>
                </div>

                <div class="col-sm-6"> <!-- Five COLUMN -->
                    <div class="form-group">
                        <label for="" class="col-sm-4 control-label"> Delivery Date </label>
                        <div class="col-sm-8">
                        <input type="text" class="form-control" id="" name="TaxDate" placeholder="">

                    </div>
                    </div>

                    <div class="form-group">
                        <label for="" class="col-sm-4 control-label">Marketing </label>
                        <div class="col-sm-8">
                        <input type="text" class="form-control" id="" name="SlpCode" placeholder="">
                        </div>
                    </div>
                </div>

                <div class="col-sm-6"> <!-- Six COLUMN -->
                    <div class="form-group">
                        <label for="" class="col-sm-4 control-label"> Usd Rate </label>
                        <div class="col-sm-8">
                        <input type="text" class="form-control" id="" name="DocRate" placeholder="">

                    </div>
                    </div>

                    <div class="form-group">
                        <label for="" class="col-sm-4 control-label">Owner </label>
                        <div class="col-sm-8">
                        <input type="text" class="form-control" id="" name="Owner" placeholder="">
                        </div>
                    </div>
                </div>
        </div>
    </div><!-- END PANEL -->
</div>


<h1>Sales Order</h1>

 
   
       
       


            <table class="table table-light " id="myTable">
                <thead class="thead-light">
                    <tr>
                        <th>#</th>
                        <th>Item No</th>
                        <th>Qty</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td></td>
                        <td><input type="text" name="itemno[]" id=""></td>
                        <td><input type="text" name="Quantity[]" id=""></td>
                        <td><input type="text" name="Amount[]" id=""></td>
                        <td><input type="text" name="Color[]" id=""></td>
                        <td><input type="text" name="Style[]" id=""></td>
                        <td><input type="text" name="ItemRef[]" id=""></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td><input type="text" name="itemno[]" id=""></td>
                        <td><input type="text" name="Quantity[]" id=""></td>
                        <td><input type="text" name="Amount[]" id=""></td>
                        <td><input type="text" name="Color[]" id=""></td>
                        <td><input type="text" name="Style[]" id=""></td>
                        <td><input type="text" name="ItemRef[]" id=""></td>
                    </tr>
                </tbody>
                <tfoot>
                    <tr>
                        <th>#</th>
                    </tr>
                </tfoot>
            </table>
     
    
        <button class="btn-primary">Save</button>
        </form>
    </div>
</body>
<script>

</script>
</html>

SalesController.php

<?php

namespace App\Http\Controllers;

use App\SalesOrder;
use App\SalesItem;
use Illuminate\Http\Request;

class SalesOrderController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        //
    }

    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create()
    {
        //
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        //

        $sales = new SalesOrder();
        $sales->CardCode = $request->CardCode;
        $sales->CardName = $request->CardName;
        $sales->CntctCode = $request->CntctCode;
        $sales->NumAtCard = $request->NumAtCard;
        $sales->DocCur = $request->DocCur;
        $sales->DocRate = $request->DocRate;
        $sales->Series = $request->Series;
        $sales->DocNum = $request->DocNum;
        $sales->DocDueDate = $request->DocDueDate;
        $sales->TaxDate = $request->TaxDate;
        $sales->SlpCode = $request->SlpCode;
        $sales->Owner = $request->Owner;
        $id = $sales->save();

        foreach ($request->itemno as $key => $val){
            $data = array("ItemCode"=>$request->itemno[$key],"Quantity"=>$request->Quantity[$key],"Amount"=>$request->Amount[$key],"Color"=>$request->Color[$key],"Style"=>$request->Style[$key],"ItemRef"=>$request->ItemRef[$key]);
            SalesItem::insert( $data);
        }

        

    }

    /**
     * Display the specified resource.
     *
     * @param  \App\SalesOrder  $salesOrder
     * @return \Illuminate\Http\Response
     */
    public function show(SalesOrder $salesOrder)
    {
        //
    }

    /**
     * Show the form for editing the specified resource.
     *
     * @param  \App\SalesOrder  $salesOrder
     * @return \Illuminate\Http\Response
     */
    public function edit(SalesOrder $salesOrder)
    {
        //
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\SalesOrder  $salesOrder
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request, SalesOrder $salesOrder)
    {
        //
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  \App\SalesOrder  $salesOrder
     * @return \Illuminate\Http\Response
     */
    public function destroy(SalesOrder $salesOrder)
    {
        //
    }
}

SalesItemController.php

<?php

namespace App\Http\Controllers;

use App\SalesItem;
use Illuminate\Http\Request;

class SalesItemController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        //
    }

    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create()
    {
        //
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        //
    }

    /**
     * Display the specified resource.
     *
     * @param  \App\SalesItem  $salesItem
     * @return \Illuminate\Http\Response
     */
    public function show(SalesItem $salesItem)
    {
        //
    }

    /**
     * Show the form for editing the specified resource.
     *
     * @param  \App\SalesItem  $salesItem
     * @return \Illuminate\Http\Response
     */
    public function edit(SalesItem $salesItem)
    {
        //
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\SalesItem  $salesItem
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request, SalesItem $salesItem)
    {
        //
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  \App\SalesItem  $salesItem
     * @return \Illuminate\Http\Response
     */
    public function destroy(SalesItem $salesItem)
    {
        //
    }
}

SalesOrderController

<?php

namespace App\Http\Controllers;

use App\SalesOrder;
use App\SalesItem;
use Illuminate\Http\Request;

class SalesOrderController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        //
    }

    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create()
    {
        //
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        //

        $sales = new SalesOrder();
        $sales->CardCode = $request->CardCode;
        $sales->CardName = $request->CardName;
        $sales->CntctCode = $request->CntctCode;
        $sales->NumAtCard = $request->NumAtCard;
        $sales->DocCur = $request->DocCur;
        $sales->DocRate = $request->DocRate;
        $sales->Series = $request->Series;
        $sales->DocNum = $request->DocNum;
        $sales->DocDueDate = $request->DocDueDate;
        $sales->TaxDate = $request->TaxDate;
        $sales->SlpCode = $request->SlpCode;
        $sales->Owner = $request->Owner;
        $id = $sales->save();

        foreach ($request->itemno as $key => $val){
            $data = array("ItemCode"=>$request->itemno[$key],"Quantity"=>$request->Quantity[$key],"Amount"=>$request->Amount[$key],"Color"=>$request->Color[$key],"Style"=>$request->Style[$key],"ItemRef"=>$request->ItemRef[$key]);
            SalesItem::insert( $data);
        }

        

    }

    /**
     * Display the specified resource.
     *
     * @param  \App\SalesOrder  $salesOrder
     * @return \Illuminate\Http\Response
     */
    public function show(SalesOrder $salesOrder)
    {
        //
    }

    /**
     * Show the form for editing the specified resource.
     *
     * @param  \App\SalesOrder  $salesOrder
     * @return \Illuminate\Http\Response
     */
    public function edit(SalesOrder $salesOrder)
    {
        //
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\SalesOrder  $salesOrder
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request, SalesOrder $salesOrder)
    {
        //
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  \App\SalesOrder  $salesOrder
     * @return \Illuminate\Http\Response
     */
    public function destroy(SalesOrder $salesOrder)
    {
        //
    }
}

SalesOrder Migration File

<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSalesOrdersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('sales_orders', function (Blueprint $table) {
            $table->id();
            $table->string('CardCode');
            $table->string('CardName');
            $table->string('CntctCode');
            $table->string('NumAtCard');
            $table->string('DocCur');
            $table->string('DocRate');
            $table->string('Series');
            $table->string('DocNum');
            $table->date('DocDueDate');
            $table->date('TaxDate');
            $table->timestamps();
            $table->string('SlpCode');
            $table->string('Owner');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('sales_orders');
    }
}

SalesItem Migration File

<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSalesItemsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('sales_items', function (Blueprint $table) {
            $table->id();
            $table->string('ItemCode');
            $table->string('Quantity');
            $table->string('Amount');
            $table->string('Color');
            $table->string('Style');
            $table->string('ItemRef');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('sales_items');
    }
}

SalesItem Model

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class SalesItem extends Model
{
    //
    protected $table = "sales_items";
    protected $fillable = ['ItemCode','Quantity','Amount','Color','Style','ItemRef'];
}

SalesOrder model

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class SalesOrder extends Model
{
    //
    protected $table = "sales_orders";
    protected $fillable = ['CardCode','CardName','CntctCode','NumAtCard','DocCur','DocRate','Series','DocNum','DocDueDate','TaxDate','SlpCode','Owner'];
}

āϞāĻžāϰāĻžāϭ⧇āϞ āĻ reactjs āύāĻŋā§Ÿā§‡ āĻ•āĻžāϜ āĻ•āϰāĻž

āϞāĻžāϰāĻžāϭ⧇āϞ āĻ reactjs āύāĻŋā§Ÿā§‡ āĻ•āĻžāϜ āĻ•āϰāĻž :

Download Laravel7 & laravel7react boilarpalte

reactjs āĻāϰ āĻ…āύāϞāĻžāχāύ āϟ⧁āϞ :āĻ…āύ⧇āĻ• āϏāĻŽā§Ÿ html āϕ⧋āĻĄā§‡āϕ⧇ reactjs āĻāϰ jsx āĻ āĻ•āύāĻ­āĻžāĻ°ā§āϟ āĻ•āϰāĻžāϰ āĻĻāϰāĻ•āĻžāϰ āĻšā§Ÿ āφāĻŦāĻžāϰ css āϕ⧇ react āĻ āĻ­ā§āϝāĻžāϞāĻŋāĻĄ āĻ­āĻžāĻŦ⧇ āϞāĻŋāĻ–āĻžāϰ āϜāĻ¨ā§āϝ āĻāĻžāĻŽā§‡āϞāĻžā§Ÿ āĻĒ⧜āϤ⧇ āĻšā§Ÿ āϤāĻ–āύ āφāĻŽāϰāĻž āύāĻŋāĻšā§‡āϰ āϟ⧁āϞ āϗ⧁āϞ⧋ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻ•āϰāĻŦā§‹āĨ¤ htmltojsx āĻāĻ¨ā§āĻĄ css to reactjs

āĻ­āĻŋāĻœā§āϝ⧁⧟āĻžāϞ āĻˇā§āϟ⧁āĻĄāĻŋāĻ“ āϕ⧋āĻĄ āĻ āϤāĻžā§œāĻžāϤāĻžā§œāĻŋ reactjs āϕ⧋āĻĄ āϞāĻŋāĻ–āĻžāϰ āϜāĻ¨ā§āϝ āφāĻŽāϰāĻž reactjs āĻ¸ā§āύāĻŋāĻĒ⧇āϟ āĻāĻ•ā§āϏāĻŸā§‡āύāĻļāύāϟāĻŋ āχāύāĻ¸ā§āϟāϞ āĻ•āϰāĻŦā§‹ āϤāĻžāĻšāϞ⧇ āϝāĻĻāĻŋ āϕ⧋āύ⧋ āĻ•ā§āϞāĻžāϏ āϤ⧈āϰ⧀ āĻ•āϰāϤ⧇ āϚāĻžāχ āϤāĻŦ⧇ rcc āϞāĻŋāĻ–āϞ⧇ āϏāĻŽā§āĻĒā§‚āĻ°ā§āĻŖ āĻāĻ•āϟāĻŋ āĻ•ā§āϞāĻžāϏ āϤ⧈āϰ⧀ āĻšā§Ÿā§‡ āϝāĻžāĻŦ⧇ āφāϰ āĻĢāĻžāĻ™ā§āĻ•āĻļāύ āϞāĻŋāĻ–āϤ⧇ āϚāĻžāχāϞ⧇ rrc āϞāĻŋāĻ–āϞ⧇ āϏāĻŽā§āĻĒā§‚āĻ°ā§āĻŖ āĻāĻ•āϟāĻŋ āĻĢāĻžāĻ™ā§āĻ•āĻļāύ āϤ⧈āϰ⧀ āĻšā§Ÿā§‡ āϝāĻžāĻŦ⧇āĨ¤

  • ā§§.āĻĒā§āϰāĻĨāĻŽā§‡ php ā§­.⧍ āĻ­āĻžāĻ°ā§āϏāύ āĻāϰ āχāύāϭ⧇āϰāύāĻŽā§‡āĻ¨ā§āϟ āϤ⧈āϰ⧀ āĻ•āϰāϤ⧇ āĻšāĻŦ⧇āĨ¤ āĻāϜāĻ¨ā§āϝ āφāĻŽāϰāĻž Xamp,Wamp ,Uwamp ,Usbwebserver āĻŦāĻž āĻ…āĻ¨ā§āϝ āϝ⧇āϕ⧋āύ⧋ āωāĻĒāĻžā§Ÿā§‡ āφāĻŽāĻžāĻĻ⧇āϰ āϏāĻŋāĻ¸ā§āĻŸā§‡āĻŽ āĻ php āϕ⧋āĻĄ āϰāĻžāύ āĻ•āϰāĻžāϰ āĻĒāϰāĻŋāĻŦ⧇āĻļ āϤ⧈āϰ⧀ āĻ•āϰāϤ⧇ āĻĒāĻžāϰāĻŋāĨ¤
  • ⧍.Composer āχāύāĻ¸ā§āϟāϞ āĻ•āϰāϤ⧇ āĻšāĻŦ⧇ āĻāĻŦāĻ‚ āχāύāĻ¸ā§āϟāϞ āĻ•āϰāĻžāϰ āϏāĻŽā§Ÿ āĻ…āĻŦāĻļā§āϝāχ āχāĻ¨ā§āϟāĻžāϰāύ⧇āϟ āĻ•āĻžāύ⧇āĻ•āĻļāύ āϞāĻžāĻ—āĻŦ⧇ āĻāĻŦāĻ‚ php.exe āĻĢāĻžāχāϞāϟāĻŋ āχāύāĻ¸ā§āϟāϞ āĻāϰ āϏāĻŽā§Ÿ āĻĻ⧇āĻ–āĻŋā§Ÿā§‡ āĻĻāĻŋāϤ⧇ āĻšāĻŦ⧇āĨ¤
  • ā§Š.Nodejs āĻāϰ āϰ⧇āϕ⧋āĻŽā§‡āĻ¨ā§āĻĄā§‡āĻĄ āĻ­āĻžāĻ°ā§āϏāύ āχāύāĻ¸ā§āϟāϞ āĻ•āϰāϤ⧇ āĻšāĻŦ⧇
  • ā§Ē.āϞāĻžāϰāĻžāϭ⧇āϞ āĻ āĻāĻ•āϟāĻŋ āĻĒā§āϰāĻœā§‡āĻ•ā§āϟ āϤ⧈āϰ⧀ āĻ•āϰāϤ⧇ āĻšāĻŦ⧇ āĻāϜāĻ¨ā§āϝ cli āĻŦāĻž comand prump āĻ āĻāχ āϕ⧋āĻĄ āϟāĻŋ āϰāĻžāύ āĻ•āϰāϤ⧇ āĻšāĻŦ⧇ : composer create-project –prefer-dist laravel/laravel projectname āĻāĻŦāĻ‚ āχāĻ¨ā§āϟāĻžāϰāύ⧇āϟ āϏāĻ‚āϝ⧋āĻ— āϏāĻšāĻ•āĻžāϰ⧇ āĻ•āĻŋāϛ⧁āĻ•ā§āώāύ āĻ…āĻĒ⧇āĻ•ā§āώāĻž āĻ•āϰāϤ⧇ āĻšāĻŦ⧇ āϝāϤāĻ•ā§āώāĻŖ āĻĒāĻ°ā§āϝāĻ¨ā§āϤ āϞāĻžāϰāĻžāϭ⧇āϞ āĻ āĻĒā§āϰāĻœā§‡āĻ•ā§āϟ āϤ⧈āϰ⧀ āĻ•āĻŽāĻĒā§āϞāĻŋāϟ āĻšā§ŸāĨ¤ āĻĒā§āϰāĻœā§‡āĻ•ā§āϟ āϤ⧈āϰ⧀ āĻ•āĻŽāĻĒā§āϞāĻŋāϟ āĻšāϞ⧇ āϏāĻŦ⧁āϜ āĻ•āĻžāϞāĻžāϰ⧇ successfull āϞāĻŋāĻ–āĻž āφāϏāĻŦ⧇āĨ¤
  • ā§Ģ.āϞāĻžāϰāĻžāϭ⧇āϞ ā§­ āĻ reactjs āύāĻŋā§Ÿā§‡ āĻ•āĻžāϜ āĻ•āϰāĻžāϰ āϜāĻ¨ā§āϝ āĻĒā§āϰāĻĨāĻŽā§‡ āĻāχ āϕ⧋āĻĄ āĻĒā§āϰāĻœā§‡āĻ•ā§āϟ āĻĢā§‹āĻ˛ā§āĻĄāĻžāϰ āĻ āĻ•āĻŽā§āϝāĻžāĻ¨ā§āĻĄ āĻĒāϰāĻžāĻŽā§āĻĒ āĻāϰ āĻŽāĻžāĻĻā§āϧāĻŽā§‡ āϰāĻžāύ āĻ•āϰāϤ⧇ āĻšāĻŦ⧇ : composer require laravel/ui āĻāĻŦāĻ‚ āχāĻ¨ā§āϟāĻžāϰāύ⧇āϟ āϏāĻ‚āϝ⧋āĻ— āϏāĻšāĻ•āĻžāϰ⧇ āĻ•āĻŋāϛ⧁āĻ•ā§āώāύ āĻ…āĻĒ⧇āĻ•ā§āώāĻž āĻ•āϰāϤ⧇ āĻšāĻŦ⧇ āϝāϤāĻ•ā§āώāĻŖ āĻĒāĻ°ā§āϝāĻ¨ā§āϤ āĻ•āĻŽāĻĒā§āϞāĻŋāϟ āύāĻž āĻšā§ŸāĨ¤
  • ā§Ŧ.āĻāĻŦāĻžāϰ āĻāχ āϕ⧋āĻĄ āϟāĻŋ āĻ•āĻŽāĻžāĻ¨ā§āĻĄ āĻĒā§āϰ⧌āĻŽā§āĻĒ āĻāϰ āϰāĻžāύ āĻ•āϰāϤ⧇ āĻšāĻŦ⧇ :php artisan ui react āĻāĻŦāĻ‚ āχāĻ¨ā§āϟāĻžāϰāύ⧇āϟ āϏāĻ‚āϝ⧋āĻ— āϏāĻšāĻ•āĻžāϰ⧇ āĻ•āĻŋāϛ⧁āĻ•ā§āώāύ āĻ…āĻĒ⧇āĻ•ā§āώāĻž āĻ•āϰāϤ⧇ āĻšāĻŦ⧇ āϝāϤāĻ•ā§āώāĻŖ āĻĒāĻ°ā§āϝāĻ¨ā§āϤ āĻ•āĻŽāĻĒā§āϞāĻŋāϟ āύāĻž āĻšā§ŸāĨ¤
  • ā§­.āĻāĻŦāĻžāϰ āĻāχ āϕ⧋āĻĄ āϟāĻŋ āĻ•āĻŽāĻžāĻ¨ā§āĻĄ āĻĒā§āϰ⧌āĻŽā§āĻĒ āĻāϰ āϰāĻžāύ āĻ•āϰāϤ⧇ āĻšāĻŦ⧇ :npm install āĻāĻŦāĻ‚ āχāĻ¨ā§āϟāĻžāϰāύ⧇āϟ āϏāĻ‚āϝ⧋āĻ— āϏāĻšāĻ•āĻžāϰ⧇ āĻ•āĻŋāϛ⧁āĻ•ā§āώāύ āĻ…āĻĒ⧇āĻ•ā§āώāĻž āĻ•āϰāϤ⧇ āĻšāĻŦ⧇ āϝāϤāĻ•ā§āώāĻŖ āĻĒāĻ°ā§āϝāĻ¨ā§āϤ āĻ•āĻŽāĻĒā§āϞāĻŋāϟ āύāĻž āĻšā§ŸāĨ¤
  • ā§Ž.āĻāĻŦāĻžāϰ āĻāχ āϕ⧋āĻĄ āϟāĻŋ āĻ•āĻŽāĻžāĻ¨ā§āĻĄ āĻĒā§āϰ⧌āĻŽā§āĻĒ āĻāϰ āϰāĻžāύ āĻ•āϰāϤ⧇ āĻšāĻŦ⧇ :npm run devāĻāĻŦāĻ‚ āχāĻ¨ā§āϟāĻžāϰāύ⧇āϟ āϏāĻ‚āϝ⧋āĻ— āϏāĻšāĻ•āĻžāϰ⧇ āĻ•āĻŋāϛ⧁āĻ•ā§āώāύ āĻ…āĻĒ⧇āĻ•ā§āώāĻž āĻ•āϰāϤ⧇ āĻšāĻŦ⧇ āϝāϤāĻ•ā§āώāĻŖ āĻĒāĻ°ā§āϝāĻ¨ā§āϤ āĻ•āĻŽāĻĒā§āϞāĻŋāϟ āύāĻž āĻšā§ŸāĨ¤
  • ⧝.āĻāĻŦāĻžāϰ āĻāχ āϕ⧋āĻĄ āϟāĻŋ āĻ•āĻŽāĻžāĻ¨ā§āĻĄ āĻĒā§āϰ⧌āĻŽā§āĻĒ āĻāϰ āϰāĻžāύ āĻ•āϰāϤ⧇ āĻšāĻŦ⧇ : php artisan serve
  • ā§§ā§Ļ.āĻāĻŦāĻžāϰ āĻŦā§āϰāĻžāωāϜāĻžāϰ āĻ http://127.0.0.1:8000/ āĻāχ āϞāĻŋāĻ‚āĻ• āϟāĻŋ āϤ⧇ āϗ⧇āϞ⧇ āφāĻŽāϰāĻž āφāĻŽāĻžāĻĻ⧇āϰ āϞāĻžāϰāĻžāϭ⧇āϞ āĻĒā§āϰāĻœā§‡āĻ•ā§āϟāϟāĻŋ āĻĻ⧇āĻ–āϤ⧇ āĻĒāĻžāĻŦā§‹

ā§§ā§§.āφāĻŽāϰāĻž āĻāĻŦāĻžāϰ āĻāχ āĻ­āĻŋāω āϕ⧇ REACT āĻĻā§āĻŦāĻžāϰāĻž āĻĒāϰāĻŋāĻŦāĻ°ā§āϤāύ āĻ•āϰāĻŦā§‹ āĻāϜāĻ¨ā§āϝ resources/js/components/ āĻĢā§‹āĻ˛ā§āĻĄāĻžāϰ āĻāϰ āĻŽāĻ§ā§āϝ⧇ index.js āύāĻžāĻŽ āĻ āĻāĻ•āϟāĻŋ āĻĢāĻžāχāϞ āϤ⧈āϰ⧀ āĻ•āϰāĻŦā§‹āĨ¤
⧧⧍. resources/js/components/ āĻĢā§‹āĻ˛ā§āĻĄāĻžāϰ āĻāϰ Example.js āĻĢāĻžāχāϞ āĻāϰ āϏāĻŦ āĻ•āĻĒāĻŋ āĻ•āϰ⧇ index.js āĻĢāĻžāχāϞ āĻ āĻĒ⧇āĻ¸ā§āϟ āĻ•āϰ⧇ āĻ•āĻŋāϛ⧁ āĻĒāϰāĻŋāĻŦāĻ°ā§āϤāύ āĻ•āϰāĻŦā§‹āĨ¤
ā§§ā§Š. resources/js/App.js āĻĢāĻžāχāϞ āĻ index.js āĻ•āĻŽā§āĻĒā§‹āύ⧇āĻ¨ā§āϟ āϟāĻŋ āĻ…ā§āϝāĻžāĻĄ āĻ•āϰāĻŦā§‹ āĻāχ āϕ⧋āĻĄ āĻĻāĻŋā§Ÿā§‡ :require(‘./components/index’);
ā§§ā§Ē. āĻāĻŦāĻžāϰ āφāĻŽāϰāĻž view āĻĢā§‹āĻ˛ā§āĻĄāĻžāϰ āĻāϰ welcome āĻĢāĻžāχāϞ āϕ⧇ āĻāĻĄāĻŋāϟ āĻ•āϰāĻŦā§‹ āĻāϜāĻ¨ā§āϝ html āĻŦāĻĄāĻŋ āĻļ⧇āώ āĻšāĻ“ā§ŸāĻžāϰ āĻĒāϰ App.js āĻĢāĻžāχāϞ āϜāĻžāĻ­āĻžāĻ¸ā§āĻ•ā§āϰāĻŋāĻĒā§āϟ āĻĢāĻžāχāϞ āĻšāĻŋāϏāĻžāĻŦ⧇ āĻ…ā§āϝāĻžāĻĄ āĻ•āϰāĻŦā§‹ āĻāĻ­āĻžāĻŦ⧇


ā§§ā§Ģ. āĻāĻŦāĻ‚ āĻāϰ āĻŽāĻ§ā§āϝ⧇ āϝāĻž āϞāĻŋāĻ–āĻŦā§‹ āϤāĻžāχ āφāĻŽāĻžāĻĻ⧇āϰ āĻļā§‹ āĻ•āϰāĻŦ⧇
ā§§ā§Ŧ.āĻāĻŦāĻžāϰ āĻĒā§āϰāĻœā§‡āĻ•ā§āϟ āĻāϰ āϰ⧁āϟ āĻĢā§‹āĻ˛ā§āĻĄāĻžāϰ āĻ cli āĻŦāĻž āĻ•āĻŽāĻžāĻ¨ā§āĻĄ āĻĒāϰāĻžāĻŽā§āĻĒ āĻ āĻāχ āϕ⧋āĻĄ āϟāĻŋ āχāĻ¨ā§āϟāĻžāϰāύ⧇āϟ āϏāĻ‚āϝ⧋āĻ— āϏāĻšāĻ•āĻžāϰ⧇ āϰāĻžāύ āĻ•āϰ⧇ : npm run dev

ā§§ā§­. āĻāĻŦāĻžāϰ āĻŦā§āϰāĻžāωāϜāĻžāϰ āĻ āĻĒā§āϰāĻœā§‡āĻ•ā§āϟ āϟāĻŋ āϰāĻžāύ āφāϏāĻŦ⧇

āϞāĻžāϰāĻžāϭ⧇āϞ reactjs āĻ āĻŦ⧁āϟāĻ¸ā§āĻŸā§āĻ°ā§āϝāĻžāĻĒ āĻāϰ css āĻ“ js āύāĻŋā§Ÿā§‡ āĻ•āĻžāϜ āĻ•āϰāĻžāϰ āϜāĻ¨ā§āϝ : āφāĻŽāϰāĻž āϏāĻŦāĻžāχ āĻŦ⧁āϟāĻ¸ā§āĻŸā§āĻ°ā§āϝāĻžāĻĒ āύāĻŋā§Ÿā§‡ āĻ•āĻžāϜ āĻ•āϰāϤ⧇ āĻ…āĻ­ā§āĻ­āĻžāϏāϤ⧋ āϤāĻžāχ āφāĻŽāϰāĻž āύāĻŋāĻšā§‡āϰ āĻĒāĻĻā§āϧāϤāĻŋ āĻ…āĻŦāϞāĻŽā§āĻŦāύ āĻ•āϰāĻŦā§‹ : āĻĒā§āϰāĻĨāĻŽā§‡ āĻĒā§āϰāĻœā§‡āĻ•ā§āϟ āĻĢā§‹āĻ˛ā§āĻĄāĻžāϰāϟāĻŋ cmd āϤ⧇ āĻ“āĻĒ⧇āύ āĻ•āϰ⧇ āϞāĻŋāĻ–āĻŦā§‹
npm install –save bootstrap āĻāĻŦāĻžāϰ⧇āϰ āĻ•āĻŋāϛ⧁āĻ•ā§āώāύ āĻ…āĻĒ⧇āĻ•ā§āώāĻž āĻ•āϰ⧇ āĻ•āĻŽāĻĒā§āϞāĻŋāϟ āĻšāϞ⧇ App.js āĻĢāĻžāχāϞ āĻ āĻŦ⧁āϟāĻ¸ā§āĻŸā§āϰāĻžāĻĒāϟāĻŋ āχāĻŽā§āĻĒā§‹āĻ°ā§āϟ āĻ•āϰāĻŦā§‹ āĻāĻ­āĻžāĻŦ⧇ import Bootstrap from ‘bootstrap/dist/css/bootstrap.min.css’; āĻāĻŦāĻžāϰ cmd āϤ⧇ npm run dev āϞāĻŋāϖ⧇ āĻāĻ¨ā§āϟāĻžāϰ āĻ•āϰāϞ⧇ reactjs āĻ…āĻĒā§āĻĒāϟāĻŋ āĻŦāĻŋāĻ˛ā§āĻĄ āĻšāĻŦ⧇ āĻāĻŦāĻžāϰ āφāĻŽāϰāĻž āĻĒā§āϰāĻœā§‡āĻ•ā§āϟ āĻāϰ āχāωāφāϰāĻāϞ āϟāĻŋ āϰāĻŋāĻĢā§āϰ⧇āĻļ āĻ•āϰāϞ⧇ āϤāĻžāϰ āĻĒāϰāĻŋāĻŦāĻ°ā§āϤāύ āϝ⧇ āϝ⧇āϗ⧁āϞ⧋ āĻ•āĻŽā§āĻĒā§‹āύ⧇āĻ¨ā§āϟ āĻ āφāĻŽāϰāĻž āĻŦ⧁āϟāĻ¸ā§āĻŸā§āĻ°ā§āϝāĻžāĻĒ āĻāϰ āĻ•ā§āϞāĻžāϏ āĻŦ⧇āĻŦāĻšāĻžāϰ āĻ•āϰ⧇āĻ›āĻŋ āϤāĻž āĻ•āĻžāϜ āĻ•āϰāϛ⧇

āϞāĻžāϰāĻžāϭ⧇āϞ reactjs āĻĒā§āϰāĻœā§‡āĻ•ā§āϟ āĻ āϰāĻŋāĻāĻ•ā§āϟ router āύāĻŋā§Ÿā§‡ āĻ•āĻžāϜ āĻ•āϰāĻž : āϏāĻžāĻŽāĻžāĻĻ āϤ⧇ āϰāĻžāύ āĻ•āϰāĻŋ npm install react-router-dom –save āĻ•āĻŋāϛ⧁āĻ•ā§āώāύ āĻ…āĻĒ⧇āĻ•ā§āώāĻž āĻ•āϰ⧇ āĻ•āĻŽāĻĒā§āϞāĻŋāϟ āĻšāϞ⧇ āφāĻŽāϰāĻž āϝ⧇ āĻĢāĻžāχāϞ āĻ āϰāĻŋāĻāĻ•ā§āϟ āϰāĻžāωāϟāĻžāϰ āĻŦ⧇āĻŦāĻšāĻžāϰ āĻ•āϰāĻŦā§‹ āϏ⧇āχ āĻĒ⧇āϜ āĻ āχāĻŽā§āĻĒā§‹āĻ°ā§āϟ āĻ•āϰāĻŋ āĻāĻ­āĻžāĻŦ⧇ : import {
BrowserRouter as Router,
Switch,
Route,
Link
} from “react-router-dom”;

ā§§ā§Ž.. āĻāĻŦāĻžāϰ āφāĻŽāϰāĻž āϞāĻ—āχāύ āĻ“ āϰ⧇āϜāĻŋāĻ¸ā§āĻŸā§āϰ⧇āĻļāύ āϏāĻŋāĻ¸ā§āĻŸā§‡āĻŽ āϤ⧈āϰ⧀ āĻ•āϰāĻŦā§‹ āϝāĻžāϤ⧇ āĻ…āĻ¨ā§āϝ āĻ•ā§€ā§Ÿ āφāĻŽāĻžāĻĻ⧇āϰ āĻāĻĒā§āϞāĻŋāϕ⧇āĻļāύ āĻ āĻĸ⧁āĻ•āϤ⧇ āύāĻž āĻĒāĻžāϰ⧇ āĻāϜāĻ¨ā§āϝ āĻĒā§āϰāĻĨāĻŽā§‡ āĻĒā§āϰāĻœā§‡āĻ•ā§āϟ āĻĢā§‹āĻ˛ā§āĻĄāĻžāϰ āĻ āĻ—āĻŋā§Ÿā§‡
ā§§.composer require laravel/ui āĻāχ āϕ⧋āĻĄ āϟāĻŋ āφāĻŽāĻžāĻĻ⧇āϰ āϞāĻžāĻ—āĻŦ⧇ āύāĻž āĻ•āĻžāϰāĻŖ āφāĻŽāϰāĻž āĻĒā§‚āĻ°ā§āĻŦ⧇ āϰāĻŋāĻāĻ•ā§āϟ āχāύāĻ¸ā§āϟāϞ āĻ•āϰāĻžāϰ āĻĒā§‚āĻ°ā§āĻŦ⧇ āĻāχ āϕ⧋āĻĄ āϰāĻžāύ āĻ•āϰ⧇ āĻ“āχ āϗ⧁āϞ⧋ āύāĻŋā§Ÿā§‡ āϚāĻŋ āĻāĻŦāĻžāϰ āύāĻŋāĻšā§‡āϰ āϕ⧋āĻĄ āϰāĻžāύ āĻ•āϰāĻŋ
⧍.php artisan ui:auth āĻāĻŦāĻžāϰ āύāĻŋāĻšā§‡āϰ āϕ⧋āĻĄ āϰāĻžāύ āĻ•āϰāĻŋ
ā§Š.php artisan ui react –auth (āφāĻŽāϰāĻž āϝāĻĻāĻŋ vue āĻŦāĻž bootstrap āωāϏ⧇ āĻ•āϰāĻŋ āϤāĻžāĻšāϞ⧇ āĻāχ āϕ⧋āĻĄ āϗ⧁āϞ⧋ āϰāĻžāύ āĻ•āϰāĻŦā§‹ php artisan ui vue –auth
āĻāĻŦāĻ‚ php artisan ui bootstrap –auth
)
ā§Ē. āĻāĻŦāĻžāϰ āφāĻŽāϰāĻž āφāĻŽāĻžāĻĻ⧇āϰ āĻĒā§āϰāĻœā§‡āĻ•ā§āϟ āϕ⧇ āĻĄāĻžāϟāĻžāĻŦ⧇āϏ āĻāϰ āϏāĻžāĻĨ⧇ āĻ•āύāĻĢāĻŋāĻ—āĻžāϰ āĻ•āϰāĻŦā§‹ āĻāϜāĻ¨ā§āϝ .env āĻĢāĻžāχāϞ āĻ āĻĄāĻžāϟāĻžāĻŦ⧇āϏ āĻ•āύāĻĢāĻŋāĻ—āĻžāϰ āĻ•āϰāĻŋ
ā§Ģ.āĻāĻŦāĻžāϰ āφāĻŽāĻžāĻĻ⧇āϰ āĻāĻĒā§āϞāĻŋāϕ⧇āĻļāύ migrate āĻ•āϰāĻžāϰ āĻĒāĻžāϞāĻž āĻ…āύ⧇āĻ• āϏāĻŽā§Ÿ āĻŽāĻžāχāĻ—ā§āϰ⧇āϟ āĻ•āϰāĻžāϰ āϏāĻŽā§Ÿ āĻāϰāϰ āĻļā§‹ āĻ•āϰ⧇ āĻāϜāĻ¨ā§āϝ āφāĻŽāϰāĻž app\Providers\AppServiceProvider.php āĻĢā§‹āĻ˛ā§āĻĄāĻžāϰ āĻ āĻāχ āϕ⧋āĻĄ āϟāĻŋ āϞāĻŋāĻ–āĻŦā§‹

use Illuminate\Support\Facades\Schema;
āĻāĻŦāĻ‚ boot āĻĢāĻžāĻ™ā§āĻ•āĻļāύāϟāĻŋ āĻāϰāĻ•āĻŽ āĻšāĻŦ⧇
public function boot()
{
Schema::defaultStringLength(191);
}
ā§Ŧ.āĻāĻŦāĻžāϰ migrate āĻ•āϰāĻžāϰ āϜāĻ¨ā§āϝ āĻāχ āϕ⧋āĻĄ āϰāĻžāύ āĻ•āϰāĻŋ : php artisan migrate:fresh

⧧⧝. āĻāĻŦāĻžāϰ āφāĻŽāϰāĻž āφāĻŽāĻžāĻĻ⧇āϰ āχāωāφāϰāĻāϞ āĻ http://127.0.0.1:8000/home āϞāĻŋāĻ–āϞ⧇ āύāĻŋāĻšā§‡āϰ āĻāĻ•āϟāĻŋ āĻĒ⧇āϜ āĻāϰ āĻĄā§āϝāĻžāĻļāĻŦā§‹āĻ°ā§āĻĄ āĻļā§‹ āĻ•āϰāĻŦ⧇

⧍ā§Ļ.āĻāĻŦāĻžāϰ āφāĻŽāĻŋ āϝāĻĻāĻŋ āφāĻŽāĻžāϰ resourse /views /home.blade.php āĻĢāĻžāχāϞ āϟāĻŋ āĻ“āĻĒ⧇āύ āĻ•āϰāĻŋ āϤāĻžāĻšāϞ⧇ āĻāϰāĻ•āĻŽ āϕ⧋āĻĄ āĻĻ⧇āĻ–āϤ⧇ āĻĒāĻžāĻŦā§‹

@extends('layouts.app')

@section('content')
<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card">
                <div class="card-header">Dashboard</div>

                <div class="card-body">
                    @if (session('status'))
                        <div class="alert alert-success" role="alert">
                            {{ session('status') }}
                        </div>
                    @endif

                    You are logged in!
                </div>
            </div>
        </div>
    </div>
</div>
@endsection

⧍⧧. āĻāĻŦāĻžāϰ āφāĻŽāĻŋ āĻāϟāĻžāϕ⧇ āĻāĻ­āĻžāĻŦ⧇ āĻŽā§‹āĻĄāĻŋāĻĢāĻžāχ āĻ•āϰāĻŦā§‹

@extends('layouts.app')

@section('content')
<div class="container">
    <div id="example"></div>
</div>
@endsection

⧍⧍.āĻāĻ–āĻžāύ⧇ āĻĻāĻŋā§Ÿā§‡āĻ›āĻŋ āϝāĻžāϤ⧇ āĻāĻ–āĻžāύ⧇ āφāĻŽāĻŋ react āĻāϰ āĻ•āĻŽā§āĻĒā§‹āύ⧇āĻ¨ā§āϟ āύāĻŋā§Ÿā§‡ āĻ•āĻžāϜ āĻ•āϰāϤ⧇ āĻĒāĻžāϰāĻŋ

ā§¨ā§Š. āĻāĻŦāĻžāϰ āφāĻŽāĻŋ āϝāĻĻāĻŋ āĻŦā§āϰāĻžāωāϏāĻžāϰ āϰāĻŋāĻĢā§āϰ⧇āĻļ āĻ•āϰāĻŋ āϤāĻžāĻšāϞ⧇ āφāĻŽāĻŋ āĻĻ⧇āĻ–āϤ⧇ āĻĒāĻžāĻŦā§‹ āϝ⧇ example id āĻāϰ āĻŽāĻ§ā§āϝ⧇ Example component āϟāĻŋ āϞ⧋āĻĄ āĻšā§Ÿā§‡ āφāϛ⧇āĨ¤

⧍ā§Ē. āĻāĻŦāĻžāϰ js/Component/Example.js āĻĢāĻžāχāϞ āϕ⧇ App.js āĻĢāĻžāχāϞ āĻ rename āĻ•āϰāĻŋ āĻāĻŦāĻ‚ āϤāĻžāϰāĻŽāĻ§ā§āϝ⧇ āϕ⧋āĻĄ āϗ⧁āϞ⧋ āĻāϰāĻ•āĻŽ āĻšāĻŦ⧇

import React from 'react';
import ReactDOM from 'react-dom';

function Example() {
    return (
        <div className="container">
            <div className="row justify-content-center">
                <div className="col-md-8">
                    <div className="card">
                        <div className="card-header">Example Component</div>

                        <div className="card-body">I'm an example component!</div>
                    </div>
                </div>
            </div>
        </div>
    );
}

export default Example;

if (document.getElementById('example')) {
    ReactDOM.render(<Example />, document.getElementById('example'));
}

⧍ā§Ģ āĻāĻŦāĻžāϰ js/Component/index.js āĻĢāĻžāχāϞ āϟāĻŋ āĻāϰāĻ•āĻŽ āĻšāĻŦ⧇

import React, { Component } from 'react';
import ReactDOM from 'react-dom';
// import App component
import App from './components/App'

// change the getElementId from example to app 
// render App component instead of Example
if (document.getElementById('root')) {
    ReactDOM.render(<App />, document.getElementById('root'));
}

⧍ā§Ŧ. āĻāĻŦāĻžāϰ js/App.js āϝ⧇ āĻĢāĻžāχāϞ āϤāĻž āφāϛ⧇ āϤāĻž āĻāϰāĻ•āĻŽ āĻšāĻŦ⧇āĨ¤

/**
 * First we will load all of this project's JavaScript dependencies which
 * includes React and other helpers. It's a great starting point while
 * building robust, powerful web applications using React + Laravel.
 */

require('./bootstrap');

/**
 * Next, we will create a fresh React component instance and attach it to
 * the page. Then, you may begin adding components to this application
 * or customize the JavaScript scaffolding to fit your unique needs.
 */

require('./components/index');

⧍⧭. āĻāĻŦāĻžāϰ home.blade.php āĻĢāĻžāχāϞāϟāĻŋ āĻāϰāĻ•āĻŽ āĻšāĻŦ⧇ āϝāĻžāϤ⧇ āφāĻŽāϰāĻž example āφāχāĻĄāĻŋ āĻāϰ āĻĒāϰāĻŋāĻŦāĻ°ā§āϤ⧇ root āĻāχāĻĄ āĻŦ⧇āĻŦāĻšāĻžāϰ āĻ•āϰāĻŦā§‹

@extends('layouts.app')

@section('content')
<div class="container">
    <div id="root"></div>
</div>
@endsection

ā§¨ā§Ž. āĻāĻŦāĻžāϰ āφāĻŽāĻžāĻĻ⧇āϰ js/Component/ āĻĢā§‹āĻ˛ā§āĻĄāĻžāϰ āĻ āĻŦāĻŋāĻ­āĻŋāĻ¨ā§āύ āĻ•āĻŽā§āĻĒā§‹āύ⧇āĻ¨ā§āϟ āĻŦāĻžāύāĻŋā§Ÿā§‡ āĻŦ⧇āĻŦāĻšāĻžāϰ āĻ•āϰāĻžāϰ āϏāĻŽā§Ÿ

⧍⧝.āĻāϟāĻž āĻ•āϰāĻžāϰ āϜāĻ¨ā§āϝ react āĻ āϝ⧇āĻ­āĻžāĻŦ⧇ āĻ•āĻŽā§āĻĒā§‹āύ⧇āĻ¨ā§āϟ āύāĻŋā§Ÿā§‡ āĻ•āĻžāϜ āĻ•āϰ⧇āĻ›āĻŋāϞāĻžāĻŽ āϏ⧇āχāĻ­āĻžāĻŦ⧇ āĻāĻ–āĻžāύ⧇ āĻ•āĻŽā§āĻĒā§‹āύ⧇āĻ¨ā§āϟ āĻŦāĻžāύāĻŋā§Ÿā§‡ āĻ•āĻžāϜ āĻ•āϰāĻŦā§‹

ā§Šā§Ļ.āĻāĻŦāĻžāϰ āφāĻŽāϰāĻž āĻāĻ–āύ āĻĨ⧇āϕ⧇ āĻāĻ•āϟāĻŋ āĻāĻĒā§āϞāĻŋāϕ⧇āĻļāύ āĻŦāĻžāύāĻžāĻŦā§‹ āĻāχ And Eita āϟāĻŋāωāĻŸā§‹āϰāĻŋ⧟āĻžāϞ āĻĢāϞ⧋ āĻ•āϰ⧇āĨ¤

āϞāĻžāϰāĻžāϭ⧇āϞ āĻ“ āϰāĻŋāĻāĻ•ā§āϟ āĻāϰ crud āĻ¸ā§āĻŸā§‡āĻĒ āĻŦāĻžāχ āĻ¸ā§āĻŸā§‡āĻĒ :
ā§§. āĻĒā§āϰāĻĨāĻŽā§‡ model,migration,controller āϤ⧈āϰ⧀ āĻ•āϰ⧇ āύ⧇āχ āĻĄā§‡āĻŽā§‹ āĻšāĻŋāϏāĻžāĻŦ⧇ āφāĻŽāĻŋ Product āύāĻžāĻŽ āĻāĻ•āϟāĻŋ āϰāĻŋāϏ⧋āĻ°ā§āϏ⧇ āĻ•āĻ¨ā§āĻŸā§āϰ⧋āϞāĻžāϰ āĻāϰ āϏāĻžāĻĨ⧇ āĻŽāĻĄā§‡āϞ āϤ⧈āϰ⧀ āĻ•āϰāϞāĻžāĻŽ

php artisan make:model Product

product.php

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Product extends Model
{
    //
    protected $fillable = ['title','body'];
}

product migration file

<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateProductsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('products', function (Blueprint $table) {
            $table->id();
            $table->string('title');
            $table->string('body');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('products');
    }
}

routes/api.php

Route::resource('products', 'ProductController');




laravel+reactjs crud link