Author: Nusrat Faria
I Am A Web Developer And A Android Developer. This Is My Personal Blog So Noted My Work For Helping People .
Clone Laravel Project from Github
git clonecreate a .env file copy content from .env.example and update the valuescomposer install && composer updatephp artisan cron:refresh-databasenpm install && npm run devphp artisan key:genphp artisan serve
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
- Install Bootstrap :
- Flash Message :
- excel Import Export tested Import
- Laravel Crud
- Restfull Api
- Image Crud
- Pagination
- ImageUpload With Resize && Multiple Image upload with resize
- Database Seeding demo data import
- Social Login
- 404Page
- Restfull Api Passport Auth Crud Another Link
- Laravel Vue Crud
- vue axiost Form
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