Laravel Tutorials
- What is laravel
- Laravel Installation
- Directory Structure
- htaccess
- Remove public from url
- Artisan Command
- Laravel Configuration
- Routing Configuration
- Namespaces
- Request
- Response
- Controller
- Model
- User Authentication
- Multi User Authentication
- Database Seeding
- Database
- Database Query
- ORM
- One-to-One Relationship
- One-to-Many Relationship
- Many to Many Eloquent Relationship
- Has One Through
- Has Many Through
- Querying Relations
- Middleware
- Laravel Views
- Blade Views
- Print data on view page
- Get Site URL
- Get URL Segment
- Get images from Storage folder
- Clear cache
- Form Class not found
- Flash Message in laravel
- Redirections
- path
- CRUD Projerct
- CRUD in Laravel
- CRUD progran
- Laravel Validation
- Jquery Validation
- Cookie
- Session
- Email Send in laravel
- File uploading
- CSRF Protection
- Helper in Laravel
- Helper Functions
- Guzzle Http Client
- Paypal Payment Gatway Integration
- Cron Job in laravel
- Flash message
- path
- Errors Handling
- Date Format
- Date Format Validation
- Display Image on View Page
- Update User Status using toggle button
- Delete Multiple Records using Checkbox in Laravel?
- Confirmation Before Delete Record
- Delete image from storage
- Remove/Trim Empty & Whitespace From Input Requests
- Block IP Addresses from Accessing Website
- How to Disable New User Registration in Laravel
- Redirect HTTP To HTTPS Using Laravel Middleware
- CKEditor
- slug generate unique
- Prevent Browser's Back Button After Logout
- Datatable dunamically
- encrypt & Decript
- Download File
- Rest API
- Shopping Cart
- Shopping Cart Example
- Dynamic Category-Subcategory Menu
- Ajax Search
- Interview Question
- laravel Tutorilal link
- laravel Tutorilal
Important Links
How to insert,delete,edit data in larvel?
View page
File name : userregister.blade.php
@include('admin/header');
<!-- ======================== Toster Notification ==================================== -->
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js"></script>
<!-- ======================== End ===================================== -->
<!-- ============================================================== -->
<!-- Start Page Content here -->
<!-- ============================================================== -->
<div class="content-page">
<div class="content">
<!-- Start Content-->
<div class="container-fluid">
<!-- start page title -->
<div class="row">
<div class="col-12">
<div class="page-title-box">
<div class="page-title-right">
<ol class="breadcrumb m-0">
<li class="breadcrumb-item"><a href="javascript: void(0);">Minton</a></li>
<li class="breadcrumb-item"><a href="javascript: void(0);">Forms</a></li>
<li class="breadcrumb-item active">Form Elements</li>
</ol>
</div>
<h4 class="page-title">Form Elements</h4>
</div>
</div>
</div>
<!-- end page title -->
@if(session()->has('message'))
<div class="alert alert-success">
{{ session()->get('message') }}
</div>
@endif
@if ($message = Session::get('error'))
<div class="alert alert-danger alert-block">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong>{{ $message }}</strong>
</div>
@endif
@if(Session::has('message'))
<p class="alert {{ Session::get('alert-class', 'alert-info') }}">{{-- Session::get('message') --}}</p>
@endif
@if(session('success'))
<h1>{{session('success')}}</h1>
@endif
@if(isset($error))
<div class="alert alert-danger alert-dismissible fade show" role="alert">
$error
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
@endif
@if (count($errors) > 0)
<div class="alert alert-danger">
<ul>
@foreach($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<div class="row">
<div class="col-12">
<div class="card-box">
<h4 class="header-title">User Registration Forms</h4>
<div class="row">
<div class="col-12">
<div class="p-2">
<!--<form class="form-horizontal" role="form" name="frm" action="{{ url('/registeruser')}}" method="post" enctype="multipart/form-data">-->
{{ Form::open(array('url' => '/registeruser','files' => true, 'method'=>'post', 'enctype'=>'multipart/form-data' )) }}
<!-- {{ csrf_field() }} -->
@csrf
<!-- <input type = "hidden" name = "_token" value = "<?php //echo csrf_token(); ?>">-->
<div class="form-group row">
<label class="col-sm-2 col-form-label" for="simpleinput">Name</label>
<div class="col-sm-10">
<input type="text" id="name" name="name" class="form-control"
placeholder="Enter Your Name">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label" for="example-email">Email</label>
<div class="col-sm-10">
<input type="email" id="email" name="email"
class="form-control" placeholder="Email">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label" for="example-password">Password</label>
<div class="col-sm-10">
<input type="password" class="form-control"
id="password" name="password" placeholder="Password">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label" for="example-number">Mobile</label>
<div class="col-md-10">
<input class="form-control" type="number"
id="mobile" name="mobile" placeholder="Enter Mobile No">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label" for="example-textarea">Address</label>
<div class="col-sm-10">
<textarea class="form-control" id="address" name="address"
rows="5"></textarea>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label" for="example-number">Gender</label>
<div class="col-md-10">
<div class="custom-control custom-radio">
<input type="radio" id="customRadio1" name="gender"
class="custom-control-input" value="male"> <label
class="custom-control-label" for="customRadio1">Male</label>
</div>
<div class="custom-control custom-radio">
<input type="radio" id="customRadio2" name="gender"
class="custom-control-input" value="female"> <label
class="custom-control-label" for="customRadio2" >Female</label>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">State</label>
<div class="col-sm-10">
<select class="form-control" name="state" id="state">
<option value="">--- Please Select State ---</option>
<option value="delhi">Delhi</option>
<option value="up">UP</option>
<option value="bihar">Bihar</option>
<option value="jharkhand">Jharkhand</option>
<option value="westbengal">WestBengal</option>
</select>
</div>
</div>
<!--<div class="form-group row">
<label class="col-sm-2 col-form-label"
for="example-fileinput">Profile Pic</label>
<div class="col-sm-10">
<input type="file" class="form-control"
id="filename" name="filename">
</div>
</div>-->
<div class="form-group row">
<label class="col-sm-2 col-form-label" for="example-date">Date
Of Birth</label>
<div class="col-sm-10">
<input class="form-control" type="date" name="dob"
id="dob">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label" for="example-date">Profile Image</label>
<div class="col-sm-10">
<input class="form-control" type="file" name="thumbnail" id="thumbnail">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label" for="example-date">Hobbies</label>
<div class="col-sm-10">
<input type="checkbox" name="hobbies[]" id="netsurfing" value="netsurfing">
<label for="south">Net Surfing</label>
<input type="checkbox" name="hobbies[]" id="socilamedia" value="socilamedia">
<label for="north">Social Media</label>
<input type="checkbox" name="hobbies[]" id="swiming" value="swiming">
<label for="east">Swiming</label>
</div>
</div>
<center>
<button type="submit"
class="btn btn-primary btn-rounded width-md waves-effect waves-light">Submit</button>
</center>
<!--</form>-->
{{ Form::close()}}
</div>
</div>
</div>
<!-- end row -->
</div>
<!-- end card-box -->
</div>
<!-- end col -->
</div>
<!-- end row -->
</div>
<!-- container -->
</div>
<!-- content -->
@include('admin/footer');
Controller
File name : Userregister.php
<?php
namespace App\Http\Controllers\admin;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use DB;
use App\Registeruser;
use Session;
//use Validator;
class UserRegister extends Controller
{
public function notification(){
$notification = array(
'message' => 'Thanks! We shall get back to you soon.',
'alert-type' => 'success'
);
session()->set('notification',$notification);
return view('admin.userregister');
}
public function __construct()
{
//$this->middleware('auth');
/* if (session()->has('username')) {
return redirect('home');
}
else {
return redirect('/');
}
*/
/*
if (!$request->session()->exists('user')) {
// user value cannot be found in session
return redirect('/');
}*/
}
public function registrationform()
{
/*if (Session()->has('username')) {
//echo Session()->get('userkey');
return view('admin/userregister');
//return view('admin.userregister');
}
else {
return redirect('/');
}
*/
//return view('admin/userregister');
return view('admin.userregister');
}
public function register_user(Request $request)
{
/* ###################### Form Validation ################### */
/* $this->validate(request(),[
//put fields to be validated here
]);
*/
$this->validate($request,[
'name' => 'required',
'email' => 'required|email|unique:registerusers',
'password' => 'required|alphaNum|max:12|min:4',
//'password' => 'required|confirmed|alphaNum|max:12|min:4',
'mobile' => 'required|Numeric|digits:10',
// 'phone' => 'required|regex:/^([0-9\s\-\+\(\)]*)$/|min:10',
'address'=> 'required',
'gender'=> 'required',
'state'=> 'required',
'dob'=> 'required|date',
'thumbnail' => 'required|image|mimes:jpeg,png,jpg,gif',
//'dob'=> 'required|date|date_format:YYYY-mm-dd',
//'phone' => 'required|digits:10',
//'phone' => 'required|regex:/^([0-9\s\-\+\(\)]*)$/|min:10',
]);
/*
$request->validate([
'name' => 'required',
'phone' => 'required|regex:/^([0-9\s\-\+\(\)]*)$/|min:10',
'email' => 'required|email|unique:users'
]);
$input = $request->all();
$user = User::create($input);
return back()->with('success', 'User created successfully.');
*/
/*
$rules = array(
'email' => 'required|email',
'password' => 'required|alphaNum|min:3'
);
//$validator = Validator::make(Input::all(), $rules);
$validator = \Validator::make($request->all(), $rules);
// if the validator fails, redirect back to the form
if ($validator->fails()) {
return Redirect::back()
->withErrors($validator)->withInput();
/*if ($validator->fails()) {
return Redirect::to('login')
->withErrors($validator) // send back all errors to the login form
->withInput(Input::except('password')); // send back the input (not the password) so that we can repopulate the form
}
*/
/* ########################## End Form Validation #################### */
/* ################### Insert Record First method ################### */
//dd(request()->all());
/* $data_array = $request->all();
DB::table('registerusers')->insert($data_array);
//echo "Record inserted successfully.<br/>";
return redirect()->back()->with('message', 'Your Data is successfully Submitted!');
*/
/* ########## Insert Record second method ################ */
if ($request->input('submit') != null ){
if($request->input('editid') !=null ){
$token = $request->input('_token');
$name = $request->input('name');
$email = $request->get('email');
$password = $request->get('password');
$mobile = $request->input('mobile');
$address = $request->input('address');
$gender = $request->get('gender');
$state = $request->input('state');
$dob = $request->input('dob');
if($name !='' && $email != ''){
$data = array('name'=>$name,"email"=>$email);
// Update
Registeruser::updateData($editid, $data);
Session::flash('message','Update successfully.');
}
}
}
else
{
// Insert record
$token = $request->input('_token');
$name = $request->input('name');
$email = $request->get('email');
$password = $request->get('password');
$mobile = $request->input('mobile');
$address = $request->input('address');
$gender = $request->get('gender');
$state = $request->input('state');
$dob = $request->input('dob');
/* $hobbies = $request->merge(['hobbies' => implode(',', (array) $request->get('hobbies'))]);
laravel::create($request->all());
*/
$hobbies = implode(',',$request->input('hobbies'));
//$hobbies = implode(",", $request->get('hobbies'));
$image = $request->file('thumbnail');
$image_name = uniqid() . '_' . time(). '.' . $image->getClientOriginalExtension();
//$uploaded_path = public_path('gallery');
$uploaded_path = storage_path('app\public\images');
$image->move($uploaded_path,$image_name);
if($name !='' && $mobile !='' && $email != ''){
$data=array('name'=>$name,"email"=>$email,"password"=>$password,"mobile"=>$mobile,"address"=>$address,'gender'=>$gender,'state'=>$state,'dob'=>$dob,'hobbies'=>$hobbies,'profilepic'=>$image_name,'_token'=>$token);
$result = DB::table('registerusers')->insert($data);
//echo "Record inserted successfully.<br/>";
return redirect()->back()->with('message', 'Your Data is successfully Submitted!');
//DB::insert('insert into registerusers (name,email) values(?,?)',[$name,$email]);
/* ############### insert by using model class ###################
$result = Registeruser::insertData($data);
if($result){
Session::flash('message','Insert successfully.');
}else{
Session::flash('message','Username already exists.');
}
/* ################################## */
} // if close
} // else close
/* ##################################################### */
//return redirect()->action('UserRegister@fetchdata',['id'=>0]);
}
/* ################### Show User List ############# */
public function showuser()
{
//$data['data'] = DB::table('registerusers')->get();
/*$data['data'] = DB::table('registerusers')->orderBy('id', 'desc')->get();
if(count($data) > 0)
{
return view('admin/registerusershow',$data);
//return view('admin.registerusershow',$data);
}
else {
return view('admin/registerusershow');
//return view('admin.registerusershow');
}
*/
// ###############################################
//$data = Registeruser::where('id', 1)->get();
//$data = Registeruser::where('id', 5)->get();
$data = Registeruser::get();
return view('admin/registerusershow',compact('data'));
// ###############################################
}
public function showuser_info(Request $request)
{
$uid = $request->post('uid');
//return Response::json($uid);
$users = Registeruser::find($uid);
return response()->json(array($users));
exit;
}
/* ############################################# */
public function fetchdata($id=0){
// Fetch all records
$userData['data'] = Registeruser::getuserData();
$userData['edit'] = $id;
// Fetch edit record
if($id>0){
$userData['editData'] = Registeruser::getuserData($id);
}
// Pass to view
return view('index')->with("userData",$userData);
}
/* ############################################# */
public function deleteUser($id=0){
if($id != 0){
// Delete
Registeruser::deleteData($id);
Session::flash('message','Delete successfully.');
}
//return redirect()->action('UserRegister@fetchdata',['id'=>0]);
return redirect('/getregisteruser');
}
public function deletedata($id)
{
DB::table('registerusers')->where('id',$id)->delete();
return redirect('/getregisteruser');
// DB::delete('delete from registerusers where id = ?',[$id]);
}
public function ajaxdeletedata($id)
{
$Users = Registeruser::find($id); // Can chain this line with the next one
$Users->delete($id);
exit;
// Employee_detail::find($id)->delete();
// DB::table('employee_details')->where('id',$id)->delete();
/*
$item = employee_details::findOrFail($id);
$item->delete();
return redirect()->route('admin.products')->with('flashSuccess', 'deleted');
*/
// return response()->json(['success' => 'Record has been deleted successfully!']);
}
public function show($id)
{
$users = DB::select('select * from registerusers where id = ?',[$id]);
return view('admin/user_update',['users'=>$users]);
}
public function userdataupdate(Request $request)
{
if($request->input('submit') != null)
{
$id = $request->input('id');
$name = $request->input('name');
$email = $request->input('email');
$password = $request->input('password');
$mobile = $request->input('mobile');
$address = $request->input('address');
$gender = $request->input('gender');
$state = $request->input('state');
$dob = $request->input('dob');
$data=array('name'=>$name,"email"=>$email,'password'=>$password,"mobile"=>$mobile,"address"=>$address,'gender'=>$gender,'state'=>$state,'dob'=>$dob);
//DB::table('employee_details')->update($data);
//DB::table('employee_details')->whereIn('id', $id)->update($request->all());
//DB::update('update registerusers set name=?,email=?,password=?,mobile=?,address=?,gender=?,state=?,dob=? where id = ?',[$name,$email,$password,$mobile,$address,$gender,$state,$dob,$id]);
/* ########### Update another method ################ */
Registeruser::updateData($id, $data);
Session::flash('message','Update successfully.');
/* ########### End Update another method ################ */
//return redirect()->back()->with('message', 'Your Data is successfully Submitted!');
//return view('employeeshow');
return redirect('/getregisteruser');
}
}
public function approveuser($id)
{
DB::table('registerusers')->where("registerusers.id", '=', $id)
->update(['registerusers.status'=> '1']);
// DB::update('update registerusers set status = ? where id = ?',['1',$id]);
// DB::table('registerusers')->where(['id' => $id])->update(['status' => '1']);
Session::flash('message','Approve User successfully.');
//return redirect()->back()->with('message', 'Your Data is successfully Submitted!');
return redirect('/getregisteruser');
}
public function notapproveuser($id)
{
DB::table('registerusers')->where("registerusers.id", '=', $id)
->update(['registerusers.status'=> '0']);
// DB::update('update registerusers set status = ? where id = ?',['0',$id]);
// DB::table('registerusers')->where(['id' => $id])->update(['status' => '0']);
Session::flash('message','Not Approve User successfully.');
//return redirect()->back()->with('message', 'Your Data is successfully Submitted!');
return redirect('/getregisteruser');
}
} // class close
Route
File name : route.php
Route::get('/userregistration', 'admin\UserRegister@registrationform');
Route::post('/registeruser','admin\UserRegister@register_user');
Route::get('/deleteUser/{id}', 'admin\UserRegister@deleteUser');
//Route::get('/{id}', 'admin\UserRegister@fetchdata');
Route::get('editdata/{id}','admin\UserRegister@show');
Route::post('editdata/{id}','admin\UserRegister@userdataupdate');
Route::get('/delete/{id}','admin\UserRegister@deletedata');
Route::delete('/userdelete/{id}','admin\UserRegister@ajaxdeletedata');
Route::get('/getregisteruser', 'admin\UserRegister@showuser');
Route::get('approve/{id}','admin\UserRegister@approveuser');
Route::get('/notapprove/{id}','admin\UserRegister@notapproveuser');
Show user details
File name : registerusershow.blade.php
@include('admin/header');
<!-- <meta name="csrf-token" content="{{ csrf_token() }}" />-->
<!-- ============================================================== -->
<!-- Start Page Content here -->
<!-- ============================================================== -->
<div class="content-page">
<div class="content">
<!-- Start Content-->
<div class="container-fluid">
<!-- start page title -->
<div class="row">
<div class="col-12">
<div class="page-title-box">
<div class="page-title-right">
<ol class="breadcrumb m-0">
<li class="breadcrumb-item"><a href="javascript: void(0);">Minton</a></li>
<li class="breadcrumb-item"><a href="javascript: void(0);">Pages</a></li>
<li class="breadcrumb-item active">Starter</li>
</ol>
</div>
<h4 class="page-title">Starter</h4>
</div>
</div>
</div>
<!-- end page title -->
@if(session()->has('message'))
<div class="alert alert-success">
{{ session()->get('message') }}
</div>
@endif
@if(Session::has('message'))
<p class="alert {{ Session::get('alert-class', 'alert-info') }}">
{{-- Session::get('message') --}}</p>
@endif
<div class="row">
<div class="col-12">
<div class="card-box table-responsive">
<h4 class="m-t-0 header-title"> </h4>
<table>
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th>Mobile</th>
<th>Password</th>
<th>Address</th>
<th>Gender</th>
<th>State</th>
<th>DOB</th>
<th>Status</th>
<th>Action</th>
<th>view</th>
</tr>
</thead>
<tbody>
@if(!empty($data))
@foreach($data as $row)
<tr id="emprecord_{{$row->id}}">
<td>{{ $row->name}}</td>
<td>{{ $row->email}}</td>
<td>{{ $row->mobile}}</td>
<td>{{ $row->password}}</td>
<td>{{ $row->address}}</td>
<td>{{ $row->gender}}</td>
<td>{{ $row->state}}</td>
<td>{{ $row->dob}}</td>
<td>{{ $row->status}}</td>
<td>
<div class="btn-group">
<button type="button" class="btn btn-secondary dropdown-toggle waves-effect waves-light" data-toggle="dropdown" aria-expanded="false">Action <span class="caret"></span></button>
<div class="dropdown-menu">
<a class="dropdown-item" href="editdata/{{ $row->id }}">Edit</a>
<a class="dropdown-item" href="<?=URL::to('/delete/')?>/{{$row->id}}">Delete</a>
<a class="dropdown-item" href="approve/{{ $row->id }}">Approve</a>
<a class="dropdown-item" href="<?=URL::to('/notapprove/')?>/{{$row->id}}">NotApprove</a>
<a class="dropdown-item del" data-id="{{$row->id}}" data-token="{{ csrf_token() }}">Delete Ajax</a>
</div>
</div>
</td>
<td>
<button type="button" class="btn btn-success waves-effect waves-light viewdata" data-toggle="modal" data-id="{{$row->id}}" data-target="#show_modal">View</button>
</td>
</tr>
@endforeach
@else
<tr>
<td class="bg-danger text-white p-1">No Data Available</td>
</tr>
@endif
</tbody>
</table>
<!-- ####################### Model 2 start ###########################-->
<div id="con-close-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Modal Content is Responsive</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="alert alert-danger" style="display:none"></div>
<form name="frm" action="addmodalpopup" method="post">
@csrf
<div class="modal-body p-4">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="field-1" class="control-label">Name</label>
<input type="text" class="form-control" name="name" id="name" placeholder="John">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="field-2" class="control-label">email</label>
<input type="text" class="form-control" name="email" id="email" placeholder="email">
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="field-3" class="control-label">mobile</label>
<input type="text" class="form-control" name="mobile" id="mobile" placeholder="Mobile">
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group no-margin">
<label for="field-7" class="control-label">Address</label>
<textarea class="form-control" name="address" id="address" placeholder="Address"></textarea>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary waves-effect" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-info waves-effect waves-light">Save changes</button>
</div>
</form>
</div>
</div>
</div><!-- /.modal -->
<!-- ####################### Model 2 End ###########################-->
</div>
</div>
</div> <!-- end row -->
</div> <!-- container -->
</div> <!-- content -->
@include('admin/footer');
Edit User data
File name : index.php
@include('admin/header');
<?php //echo View::make('header'); ?>
<!-- ============================================================== -->
<!-- Start Page Content here -->
<!-- ============================================================== -->
<div class="content-page">
<div class="content">
<!-- Start Content-->
<div class="container-fluid">
<!-- start page title -->
<div class="row">
<div class="col-12">
<div class="page-title-box">
<div class="page-title-right">
<ol class="breadcrumb m-0">
<li class="breadcrumb-item"><a href="javascript: void(0);">Minton</a></li>
<li class="breadcrumb-item"><a href="javascript: void(0);">Pages</a></li>
<li class="breadcrumb-item active">Starter</li>
</ol>
</div>
<h4 class="page-title">Starter</h4>
</div>
</div>
</div>
<!-- end page title -->
<div class="row">
<div class="col-12">
<div class="card-box">
<h4 class="header-title">User Registration Forms</h4>
<div class="row">
<div class="col-12">
<div class="p-2">
<form class="form-horizontal" role="form" name="frm" action="register_user" method="post" enctype="multipart/form-data">
<!--<form class="form-horizontal" role="form" name="frm" action="{{url('/updateuser')}}" method="post" enctype="multipart/form-data"> -->
{{ Form::open(array('url' => 'register_user','files' => true, 'method'=>'post')) }}
<!-- {{ csrf_field() }} -->
@csrf
<!-- <input type = "hidden" name = "_token" value = "<?php //echo csrf_token(); ?>">-->
<input type="hidden" name="id" value="<?php echo $users[0]->id; ?>" />
<div class="form-group row">
<label class="col-sm-2 col-form-label" for="simpleinput">Name</label>
<div class="col-sm-10">
<input type="text" id="name" name="name" class="form-control" value='<?php echo$users[0]->name; ?>'>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label" for="example-email">Email</label>
<div class="col-sm-10">
<input type="email" id="email" name="email"
class="form-control" value = '<?php echo $users[0]->email; ?>'>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label" for="example-password">Password</label>
<div class="col-sm-10">
<input type="text" class="form-control"
id="password" name="password" value = '<?php echo $users[0]->password; ?>'>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label" for="example-number">Mobile</label>
<div class="col-md-10">
<input class="form-control" type="number"
id="mobile" name="mobile" value = '<?php echo $users[0]->mobile; ?>'>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label" for="example-textarea">Address</label>
<div class="col-sm-10">
<textarea class="form-control" id="address" name="address"
rows="5"><?php echo $users[0]->address; ?></textarea>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label" for="example-number">Gender</label>
<div class="col-md-10">
<div class="custom-control custom-radio">
<input type="radio" id="customRadio1" name="gender"
class="custom-control-input" value="male" {{ $users[0]->gender == 'male' ? 'checked' : '' }}> <label
class="custom-control-label" for="customRadio1">Male</label>
</div>
<div class="custom-control custom-radio">
<input type="radio" id="customRadio2" name="gender"
class="custom-control-input" value="female" {{ $users[0]->gender == 'female' ? 'checked' : '' }}> <label
class="custom-control-label" for="customRadio2" >Female</label>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">State</label>
<div class="col-sm-10">
<select class="form-control" name="state" id="state">
<option value="delhi" {{ ($users[0]->state=="delhi")? "selected" : "" }}>Delhi</option>
<option value="up" {{ ($users[0]->state=="UP")? "selected" : "" }}>UP</option>
<option value="bihar" {{ ($users[0]->state=="bihar")? "selected" : "" }}>Bihar</option>
<option value="jharkhand" {{ ($users[0]->state=="jharkhand")? "selected" : "" }}>Jharkhand</option>
<option value="westbengal" {{ ($users[0]->state=="westbengal")? "selected" : "" }}>WestBengal</option>
</select>
</div>
</div>
<!--<div class="form-group row">
<label class="col-sm-2 col-form-label"
for="example-fileinput">Profile Pic</label>
<div class="col-sm-10">
<input type="file" class="form-control"
id="thumbnail" name="thgumbnail">
</div>
</div>-->
<div class="form-group row">
<label class="col-sm-2 col-form-label" for="example-date">Date
Of Birth</label>
<div class="col-sm-10">
<input class="form-control" type="date" name="dob" id="dob" value='<?php echo $users[0]->dob; ?>'>
</div>
</div>
<!--<input type='hidden' value='edit' name='editid'>-->
<center>
<button type="submit" name="submit" value="submit"
class="btn btn-primary btn-rounded width-md waves-effect waves-light">Submit</button>
</center>
<!-- </form> -->
{{ Form::close()}}
</div>
</div>
</div>
<!-- end row -->
</div>
<!-- end card-box -->
</div>
<!-- end col -->
</div>
<!-- end row -->
</div> <!-- container -->
</div> <!-- content -->
@include('admin/footer');
<?php //echo View::make('footer'); ?>
File name : index.php
File name : index.php
File name : index.php
File name : index.php
File name : index.php
File name : index.php
File name : index.php
File name : index.php
File name : index.php