folder to locate the pop up $error message in this code - php

I need to edit the error that shows if a user enters an amount below minimum but I can't find the file to edit the pop-up error response that shows if the amount I less than the withdrawal limit.
Here is the code.
<div class="row">
<div class="col-md-9">
<div class="card">
<div class="card-header">
<h4 class="card-title">withdrawal -
<small class="category">Cash Out Fund.</small>
</h4>
</div>
<div class="card-content">
<div class="row">
<div class="col-md-2">
<ul class="nav nav-pills nav-pills-icons nav-pills-primary nav-stacked" role="tablist">
<li class="active">
<a href="#withdraw" role="tab" data-toggle="tab">
<i class="material-icons">redeem</i>Withdraw
</a>
</li>
</ul>
</div>
<div class="col-md-10">
<div class="tab-content">
<div class="tab-pane active" id="withdraw">
<div class="alert alert-info">
<span class="text-center">Please Read before you proceed. You need to know processing fee:</span><br> #php $id=0;#endphp #foreach($gateways as $gateway) #php $id++;#endphp
<span>{{$id}}. <b>#if($gateway->name){{$gateway->name}}#endif #if($gateway->local_name){{$gateway->local_name}}#endif</b> we would charge you <b>{{config('app.currency_symbol')}} {{$gateway->fixed}}</b> fixed + <b>{{$gateway->percent}}%</b> to Withdraw.</span> #endforeach
</div>
<form action="{{route('userWithdraw.post')}}" method="post">
{{ csrf_field() }} #if(count($errors) > 0)
<div class="alert alert-danger alert-with-icon" data-notify="container">
<i class="material-icons" data-notify="icon">notifications</i>
<span data-notify="message">
#foreach($errors->all() as $error)
<li><strong> {{$error}} </strong></li>
#endforeach
</span>
</div>
<br> #endif
<div class="row">
<div class="col-md-6 col-md-offset-3">
<div class="form-group label-floating">
<select class="selectpicker" name="gateway" data-style="btn btn-warning btn-round" title="Select Withdraw Gateway" data-size="7">
#if($gate->status == 1)
<option value="1000">{{$gate->name}}</option>
#endif #foreach($gateways as $gateway)
<option value="{{$gateway->id}}">{{$gateway->name}}</option>
#endforeach
</select>
</div>
</div>
</div>
<br>
<div class="row">
<div class="col-md-6 col-md-offset-3">
<div class="form-group label-floating">
<label class="control-label" for="account">Your PayPal</label>
<input id="account" name="account" type="text" class="form-control">
</div>
</div>
</div>
<br>
<div class="row">
<div class="col-md-6 col-md-offset-3">
<div class="form-group label-floating">
<label class="control-label" for="amount">Withdraw Amount</label>
<input id="amount" name="amount" type="text" class="form-control">
</div>
</div>
</div>
I need to edit all error response that pops up in the file and any other error response on the entire website.

Related

Styles is not loading in my laravel program

I have a view which I'm returning in my AdminController which goes in this syntax.
public function create_booking(){
$set_admin = SettingAdmin::orderBy('id')->first();
return view('layouts\quickbookingmodal')->with('set_admin', $set_admin);
}
In HTML this is what im returning, this basically is a pop menu, where the admin user can fill a booking.
<div class="modal fade" id="myModal">
<div class=row>
<div class="col-sm-10 offset-sm-1">
<div class="modal-dialog modal-lg">
<form action="" method="POST">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<h4 class="modal-title">Quick Booking</h4>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<!-- Modal body -->
<div class="modal-body">
{{ csrf_field() }}
#isset($error_msg)
#foreach ($error_msg as $error)
<li class="text-danger">{{ $error }}</li>
#endforeach
#endisset
<div class="form-group row">
<label for="placeid" class="col-md-4 col-form-label text-md-right">{{ __('Place ID') }}: </label>
<div class="col-md-6">
<input type="text" class="form-control" name="place_id" required>
</div>
</div>
<div class="form-group row">
<label for="placeid" class="col-md-4 col-form-label text-md-right">{{ __('Arrival day') }}: </label>
<div class="col-md-6">
<div class="container11">
<div class="t-datepicker">
<span id="tdatepik" class="t-check-in"></span>
<input id="searchdate_numberofdays" type="number" name="no_of_day" placeholder="{{ __('Number of days') }}: 1">
#isset($maparray['err_msg'])
<span id="errormsg_txt" style="color:red;"> {{ __('You can book maximum') }} {{ $maparray["set_admin"]->max_no_days }} {{ __('days') }}.</span><br>
#endisset
<span id="errormsg_txt" style="color:red;display:none;"> {{ __('Arrival day is not selected') }}. </span><br>
</div>
</div>
</div>
</div>
<div class="form-group row">
<label for="fullname" class="col-md-4 col-form-label text-md-right">{{ __('Full Name') }}: </label>
<div class="col-md-6">
<input type="text" class="form-control" name="user_fullname" required>
</div>
</div>
<div class="form-group row">
<label for="email" class="col-md-4 col-form-label text-md-right">{{ __('Email address') }}: </label>
<div class="col-md-6">
<input type="email" class="form-control" name="user_email" required>
</div>
</div>
<div class="form-group row">
<label for="phone" class="col-md-4 col-form-label text-md-right">{{ __('Phone') }}: </label>
<div class="col-md-6">
<input type="tel" class="form-control" name="user_phone" required>
</div>
</div>
<div class="form-group row">
<label for="geust" class="col-md-4 col-form-label text-md-right">{{ __('Number of adults') }}[1-4]: </label>
<div class="col-md-6">
<select class="form-control booking_inp_textbox_style" id="numberofguest" name="numberofguest" onchange="addFieldsadmin(this.value);">
<option value="0" active>1</option>
<option value="1">2</option>
<option value="2">3</option>
<option value="3">4</option>
</select>
</div>
</div>
<div class="form-group row">
<label for="babies" class="col-md-4 col-form-label text-md-right">{{ __('Number of babies') }}[1-3]: </label>
<div class="col-md-6">
<select class="form-control booking_inp_textbox_style" id="numberofbabies" name="numberofbabies" onchange="addFieldsadmin2(this.value);">
<option value="0" active>0</option>
<option id="hidden_op_style1" value="1">1</option>
<option id="hidden_op_style2" value="2">2</option>
<option id="hidden_op_style3" value="3">3</option>
</select>
</div>
</div>
<div class="containerinput">
{{-- dynamic input surname using javascript --}}
</div>
<div class="containerinput2">
{{-- dynamic input surname using javascript --}}
</div>
<div class="form-group row">
<label for="promo" class="col-md-4 col-form-label text-md-right">{{ __('Promo Code') }}: </label>
<div class="col-md-6">
<input type="text" class="form-control" name="user_promo">
</div>
</div>
<div class="form-group row">
<label for="book" class="col-md-4 col-form-label text-md-right">{{ __('Booked By') }}: </label>
<div class="col-md-6">
<label>{{ Auth::user()->name }}</label>
</div>
</div>
#if (Auth::user()->role == 'admin')
<div class="form-group row">
<label for="Amount" class="col-md-4 col-form-label text-md-right">{{ __('Payment Type') }}: </label>
<div class="col-md-6">
<input type="radio" name="user_payment_type" value="Entrance">
<label for="Entrance" class="booking_payment_type_style">{{ __('Entrance (Cash)') }}</label>
<input type="radio" name="user_payment_type" value="Admin" checked>
<label for="Entrance" class="booking_payment_type_style">{{ __('Admin (Free)') }}</label><br>
</div>
</div>
#else
<div class="form-group row">
<label for="promo" class="col-md-4 col-form-label text-md-right">{{ __('Payment Type') }}: </label>
<div class="col-md-6">
<input type="radio" name="user_payment_type" value="Entrance" checked>
<label for="Entrance" class="booking_payment_type_style">{{ __('Entrance (Cash)') }}</label>
</div>
</div>
#endif
</div>
<!-- Modal footer -->
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-success">{{ __('Save') }}</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<script>
var today = new Date();
tomorrow = new Date(today);
tomorrow.setDate(tomorrow.getDate() + 60);
var date = tomorrow.getFullYear()+'-'+(tomorrow.getMonth()+1)+'-'+tomorrow.getDate();
$(document).ready(function(){
// Call global the function
$('.t-datepicker').tDatePicker({
// options here
titleDateRange :'{{ __('day') }}',
titleDateRanges:'{{ __('days') }}',
titleToday :'{{ __('Today') }}',
limitDateRanges :'{{ $set_admin->max_no_days+1 }}',
titleCheckIn :'{{ __('Check In') }}',
titleCheckOut :'{{ __('Check Out') }}',
numCalendar : 1,
endDate: date,
nextDayHighlighted :false,
toDayHighlighted :true,
toDayShowTitle :true,
autoClose: true,
dateRangesHover: false,
});
});
// $('.t-datepicker').tDatePicker('setEndDate','2020-07-28');
</script>
<script type="text/javascript">
#isset($error_msg)
#if (count($error_msg) > 0)
$('#myModal').modal('show');
#endif
#endisset
</script>
But anytime i load the page, it does not load it as a popup just static HTML. However i have the same popup in this page called dashboard, which when clicked shows the popup perfectly with all the styles. I'm not sure why this is happening.
#extends('layouts.adminmaster')
#section('section')
<div class="container paddingTop20">
<h1>Negombo Admin Panel</h1>
<hr>
<div class="row">
<div class="col-sm-4">
<div class="card">
<div class="card-header bg-primary">
<span class="dashboardcardstyle">{{ __('Quick Booking') }}</span>
</div>
<div class="card-body">
<center><button type="button" class="btn btn-success dashboardcardbodystyle2" data-toggle="modal" data-target="#myModal">{{ __('Book Now') }}</button></center>
#include('layouts.quickbookingmodal')
</div>
</div>
</div>
<div class="col-sm-4">
<div class="card">
<div class="card-header bg-primary">
<span class="dashboardcardstyle">Total Places</span>
</div>
<div class="card-body">
<center><span class="dashboardcardbodystyle">{{ $numberofplace }}</span></center>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="card">
<div class="card-header bg-primary">
<span class="dashboardcardstyle">Total Bookings</span>
</div>
<div class="card-body">
<center><span class="dashboardcardbodystyle">{{ $numberofbookings }}</span></center>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
#include('layouts.recentactivaty')
</div>
<div class="col-sm-2">
</div>
</div>
{{-- second row of dashboard --}}
<div class="row paddingTop20">
<div class="col-sm-4">
#if (Auth::user()->role== "admin")
<div class="card">
<div class="card-header bg-primary">
<span class="dashboardcardstyle">Total Earnings</span>
</div>
<div class="card-body">
<table style="width:100%" align="center" class="table-hover">
<tr>
<td><strong>From Entrance: </strong></td>
<td>{{ $earningEntrance }} <i class="fa fa-eur" aria-hidden="true"></i></td>
</tr>
<tr>
<td><strong>From {{ __('Agreements') }}: </strong></td>
<td>{{ $earningAgr }} <i class="fa fa-eur" aria-hidden="true"></i></td>
</tr>
<tr>
<td><strong>From Paypal: </strong></td>
<td>{{ $earningPaypal }} <i class="fa fa-eur" aria-hidden="true"></i></td>
</tr>
<tr>
<td><strong>From Stripe: </strong></td>
<td> {{ $earningStripe }} <i class="fa fa-eur" aria-hidden="true"></i></td>
</tr>
<tr>
<td><strong>From Credit Card: </strong></td>
<td>{{ $earningcard }} <i class="fa fa-eur" aria-hidden="true"></i></td>
</tr>
</table>
{{-- <center><span class="dashboardcardbodystyle">{{ $numberofbookings }}</span></center> --}}
</div>
</div>
#else
<div class="card">
<div class="card-header bg-primary">
<span class="dashboardcardstyle">Server Time</span>
</div>
<div class="card-body">
<center><span>{{ date("d M, Y") }}</span></center>
<center><span class="dashboardcardbodystyle">{{ date("h:i:s A") }}</span></center>
</div>
</div>
#endif
</div>
<div class="col-sm-4">
<div class="card">
<div class="card-header bg-primary">
<span class="dashboardcardstyle">{{ __('Total') }} {{ __('Agreements') }}</span>
</div>
<div class="card-body">
<center><span class="dashboardcardbodystyle">{{ $numberofAggr }}</span></center>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="card">
<div class="card-header bg-primary">
<span class="dashboardcardstyle">Total Entrance</span>
</div>
<div class="card-body">
<center><span class="dashboardcardbodystyle">{{ $numberofEntrance }}</span></center>
</div>
</div>
</div>
</div>
{{-- second row of dashboard --}}
</div>
#endsection
This is how the popup is supposed to look like.
But this is how it looks
This is what i get when i add the #extends('layouts.adminmaster') and #section('section')

Trying to set default Cateogry View in frontend Laravel 6

I am a total amateur on Laravel and I am trying to find a way to display by default a specific category with it's services instead of showing ALL the services for alla the categories that exist.
<section class="categories sp-80-50 bg-dull">
<div class="container">
<div class="row">
<div class="col-12">
<div class="all-title">
<p>#lang('front.categoriesTitle')</p>
<h3 class="sec-title">
#lang('front.categories')
</h3>
</div>
</div>
</div>
<div id="categories" class="row justify-content-center">
#foreach ($categories as $category)
#if($category->services->count() > 0)
<div class="col-xl-2 col-lg-3 col-md-4 col-sm-6 col-12 mb-30 categories-list" data-category-id="{{ $category->id }}">
<div class="ctg-item" style="background-image:url('{{ $category->category_image_url }}')">
<a href="javascript:;">
<div class="icon-box">
<i class="flaticon-fork"></i>
</div>
<div class="content-box">
<h5 class="mb-0">
{{ ucwords($category->name) }}
</h5>
</div>
</a>
</div>
</div>
#endif
#endforeach
</div>
</div>
</section> */
<section class="listings sp-80 bg-w">
<div class="container">
<div class="row">
<div class="col-12">
<div class="all-title">
<p> #lang('front.servicesTitle') </p>
<h3 class="sec-title">
#lang('front.services')
</h3>
</div>
</div>
</div>
<div id="services" class="row">
#foreach ($services as $service)
<div class="col-lg-3 col-md-6 col-12 mb-30 services-list service-category-{{ $service->category_id }}">
<div class="listing-item">
<div class="img-holder" style="background-image: url('{{ $service->service_image_url }}')">
<div class="category-name">
<i class="flaticon-fork mr-1"></i>{{ ucwords($service->category->name) }}
</div>
</div>``
and
var categories = `
<div class="col-xl-2 col-lg-3 col-md-4 col-sm-6 col-12 mb-30 categories-list">
</div>`;
response.categories.forEach(category => {
if (category.services.length > 0) {
var url = category.category_image_url;
categories += `
<div class="col-xl-2 col-lg-3 col-md-4 col-sm-4 col-12 mb-30 categories-list" data-category-id="${category.id}">
<div class="ctg-item" style="background-image:url('${url}')">
<a href="javascript:;">
<div class="icon-box">
<i class="flaticon-fork"></i>
</div>
<div class="content-box">
<h5 class="mb-0">
${category.name}
</h5>
</div>
</a>
</div>
</div>`
}
});
$('#categories').html(categories);
var services = '';
if (response.services.length > 0) {
response.services.forEach(service => {
services += `
<div class="col-lg-3 col-md-6 col-12 mb-30 services-list service-category-${service.category_id}">
<div class="listing-item">
<div class="img-holder" style="background-image: url('${ service.service_image_url }')">
<div class="category-name">
<i class="flaticon-fork mr-1"></i>${service.category.name}
</div>
<div class="time-remaining">
<i class="fa fa-clock-o mr-2"></i>
<span>έως ${service.time} ${makeSingular(service.time, service.time_type)}</span>
</div>
</div>
You can access the webpage at https://click-away.store
I need to set the default Services view for the 1st Button Category.
Sorry if my question is silly or the solution is simple but I couldn't find out what to do!
Your error is that you never loop over the category's services.
You check if there are any services, but you never loop over them. So, within the #if you should do that.
#foreach ($categories as $category)
#if($category->services->count() > 0)
#foreach($category->services as $service)
// your code
#endforeach
#endif
#endforeach

Setting Categories using tabs with Laravel

I would like to ask how to pull categories using tabs. I was able to pull all the items on one tab but I could not pull them per category. here is my code. The data comes from the database and seems to work on All items but I could not figure out how to pull them individually. I need some help with you expertise.
<div class="tab-content">
<div class="tab-pane container active" id="home">...</div>
<div class="tab-pane container fade" id="allItems">All Items
<div>
<div class="row">
<div class="col-12">
<div class="row">
#foreach($items as $per_item)
<div class="col-lg-4 col-6">
<div class="card mb-3">
<img src="{{$per_item->image_path}}" class="card-img-top">
<div class="card-body">
<small>{{$per_item->category->name}}</small>
<h4 class="card-title">
<a href="/items/{{$per_item->id}}">
{{$per_item->name}}
</a>
</h4>
<p class="card-text">{{$per_item->description}}</p>
<h3>{{$per_item->price}}</h3>
<form action="/cart/{{$per_item->id}}" method="POST">
#csrf
<div class="row">
<div class="col-12 col-md-5 col-lg-12 mb-2">
<input type="number" name="quantity" id="quantity"
class="w-100">
</div>
<div class="col-12 col-md-7 col-lg-12 mb-2">
<button type="submit" class="btn btn-primary">Add To
Cart</button>
</div>
</div>
</form>
</div>
</div>
</div>
#endforeach
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane container fade" id="consumables">Consumables
<div>
</div>
</div>
<div class="tab-pvane container fade" id="pnuematicTools">Pnuematic
Tools</div>

My Php Script Exception message: count(): Parameter must be an array or an object that implements Countable

"count(): Parameter must be an array or an object that implements
Countable (View:
D:\xampp\htdocs\btrade\core\resources\views\dashboard\user-details.blade.php)"
Looking for I saw that some have this error in their code, but I did not find how can i solve my problem please help me
i think This is the failing case:
#if(count($user))
My php version : PHP 7.2.0
this my error imge
this is my code
#extends('layouts.dashboard')
#section('style')
<link href="{{ asset('assets/admin/css/bootstrap-toggle.min.css') }}" rel="stylesheet">
#endsection
#section('content')
#if(count($user))
<div class="row">
<div class="col-md-12">
<div class="portlet blue box">
<div class="portlet-title">
<div class="caption font-dark">
<strong>User Details</strong>
</div>
<div class="tools"> </div>
</div>
<div class="portlet-body" style="overflow:hidden;">
<div class="col-md-3">
<div class="portlet box blue">
<div class="portlet-title">
<div class="caption uppercase bold">
<i class="fa fa-user"></i> PROFILE </div>
</div>
<div class="portlet-body text-center" style="overflow:hidden;">
<img src="#if($user->image == 'user-default.png') {{ asset('assets/images/user-default.png') }} #else {{ asset('assets/images') }}/{{ $user->image }}#endif" class="img-responsive propic" alt="Profile Pic">
<hr><h4 class="bold">User Name : {{ $user->username}}</h4>
<h4 class="bold">Name : {{ $user->name }}</h4>
<h4 class="bold">BALANCE : {{ $user->balance }} {{ $basic->currency }}</h4>
<hr>
#if($user->login_time != null)
<p>
<strong>Last Login : {{ \Carbon\Carbon::parse($user->login_time)->diffForHumans() }}</strong> <br>
</p>
<hr>
#endif
#if($last_login != null)
<p>
<strong>Last Login From</strong> <br> {{ $last_login->user_ip }} - {{ $last_login->location }} <br> Using {{ $last_login->details }} <br>
</p>
#endif
</div>
</div>
</div>
<div class="col-md-9">
<div class="row">
<div class="col-md-12">
<div class="portlet box purple">
<div class="portlet-title">
<div class="caption uppercase bold">
<i class="fa fa-desktop"></i> Details </div>
<div class="tools"> </div>
</div>
<div class="portlet-body">
<div class="row">
<!-- START -->
<a href="{{ route('user-repeat-all',$user->username) }}">
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" style="margin-bottom: 20px;">
<div class="dashboard-stat blue">
<div class="visual">
<i class="fa fa-recycle"></i>
</div>
<div class="details">
<div class="number">
<span data-counter="counterup" data-value="{{ $total_repeat }}">0</span>
</div>
<div class="desc uppercase bold"> REPEAT </div>
</div>
<div class="more">
<div class="desc uppercase bold text-center">
{{ $basic->symbol }}
<span data-counter="counterup" data-value="{{ $total_repeat_amount }}">0</span> REPEAT
</div>
</div>
</div>
</div>
</a>
<!-- END -->
<a href="{{ route('user-deposit-all',$user->username) }}">
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" style="margin-bottom: 20px;">
<div class="dashboard-stat green">
<div class="visual">
<i class="fa fa-cloud-download"></i>
</div>
<div class="details">
<div class="number">
<span data-counter="counterup" data-value="{{ $total_deposit }}">0</span>
</div>
<div class="desc uppercase bold "> DEPOSIT </div>
</div>
<div class="more">
<div class="desc uppercase bold text-center">
{{ $basic->symbol }}
<span data-counter="counterup" data-value="{{ $total_deposit_amount }}">0</span> DEPOSIT
</div>
</div>
</div>
</div>
</a>
<!-- END -->
<a href="{{ route('user-withdraw-all',$user->username) }}">
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" style="margin-bottom: 20px;">
<div class="dashboard-stat red">
<div class="visual">
<i class="fa fa-cloud-upload"></i>
</div>
<div class="details">
<div class="number">
<span data-counter="counterup" data-value="{{ $total_withdraw }}">0</span>
</div>
<div class="desc uppercase bold "> WITHDRAW </div>
</div>
<div class="more">
<div class="desc uppercase bold text-center">
{{ $basic->symbol }}
<span data-counter="counterup" data-value="{{ $total_withdraw_amount }}">0</span> WITHDRAW
</div>
</div>
</div>
</div>
</a>
<!-- END -->
<a href="{{ route('user-login-all',$user->username) }}">
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" style="margin-bottom: 20px;">
<div class="dashboard-stat yellow">
<div class="visual">
<i class="fa fa-sign-in"></i>
</div>
<div class="details">
<div class="number">
<span data-counter="counterup" data-value="{{ $total_login }}">0</span>
</div>
<div class="desc uppercase bold "> Log In </div>
</div>
<div class="more">
<div class="desc uppercase bold text-center">
VIEW DETAILS
</div>
</div>
</div>
</div>
</a>
<!-- END -->
</div>
</div>
</div>
</div>
<div class="col-md-12">
<div class="portlet box blue-ebonyclay">
<div class="portlet-title">
<div class="caption uppercase bold">
<i class="fa fa-cogs"></i> Operations </div>
</div>
<div class="portlet-body">
<div class="row">
<div class="col-md-6 uppercase">
<i class="fa fa-money"></i> add / substruct balance
</div>
<div class="col-md-6 uppercase">
<i class="fa fa-envelope-open"></i> Send Email
</div>
</div>
</div>
</div>
</div>
<div class="col-md-12">
<div class="portlet box green">
<div class="portlet-title">
<div class="caption uppercase bold">
<i class="fa fa-cog"></i> Update Profile </div>
</div>
<div class="portlet-body">
<form action="{{ route('user-details-update') }}" method="post">
{!! csrf_field() !!}
<input type="hidden" name="user_id" value="{{ $user->id }}">
<div class="row uppercase">
<div class="col-md-4">
<div class="form-group">
<label class="col-md-12"><strong>Name</strong></label>
<div class="col-md-12">
<input class="form-control input-lg" name="name" value="{{ $user->name }}" type="text">
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label class="col-md-12"><strong>Email</strong></label>
<div class="col-md-12">
<input class="form-control input-lg" name="email" value="{{ $user->email }}" type="text">
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label class="col-md-12"><strong>Phone</strong></label>
<div class="col-md-12">
<input class="form-control input-lg" name="phone" value="{{ $user->phone }}" type="text">
</div>
</div>
</div>
</div><!-- row -->
<br><br>
<div class="row uppercase">
<div class="col-md-4">
<div class="form-group">
<label class="col-md-12"><strong>STATUS</strong></label>
<div class="col-md-12">
<input data-toggle="toggle" {{ $user->status == 0 ? 'checked' : ''}} data-onstyle="success" data-size="large" data-offstyle="danger" data-on="Active" data-off="Blocked" data-width="100%" type="checkbox" name="status">
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label class="col-md-12"><strong>EMAIL VERIFICATION</strong></label>
<div class="col-md-12">
<input data-toggle="toggle" {{ $user->email_verify == 1 ? 'checked' : ''}} data-onstyle="success" data-size="large" data-offstyle="danger" data-on="Verified" data-off="Not Verified" data-width="100%" type="checkbox" name="email_verify">
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label class="col-md-12"><strong>PHONE VERIFICATION</strong></label>
<div class="col-md-12">
<input data-toggle="toggle" {{ $user->phone_verify == 1 ? 'checked' : ''}} data-onstyle="success" data-size="large" data-offstyle="danger" data-on="Verified" data-off="Not Verified" data-width="100%" type="checkbox" name="phone_verify">
</div>
</div>
</div>
</div><!-- row -->
<br><br>
<div class="row">
<div class="col-md-12">
<button type="submit" class="btn blue btn-block btn-lg">UPDATE</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div><!-- col-9 -->
</div>
</div>
</div>
</div><!-- ROW-->
#else
<div class="text-center">
<h3>No User Found</h3>
</div>
#endif
#endsection
#section('scripts')
<script src="{{ asset('assets/admin/js/bootstrap-toggle.min.js') }}"></script>
<script src="{{ asset('assets/admin/js/jquery.waypoints.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('assets/admin/js/jquery.counterup.min.js') }}" type="text/javascript"></script>
#endsection
The $user variable isn't an array. If that variable must not be an array remove the count function from if statement.
In php5, php7.0, php7.1 it works, but in php7.2 does not work.
#if($user)...
for laravel use below code in web.php
if (version_compare(PHP_VERSION, '7.2.0', '>=')) {
// Ignores notices and reports all other kinds... and warnings
error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING);
// error_reporting(E_ALL ^ E_WARNING); // Maybe this is enough
}
PHP had changed function count() in version 7.2.
In PHP 7.3 will add is_countable();
You can add this function:
function is_countable($var) {
return (is_array($var) || $var instanceof Countable);
}
if (is_countable($user) && count($user)) {
//
}
and remove it in PHP 7.3

create class and object of that in laravel 5.3

I am using laravel 5.3 for my project. I have a panel bootstrap that have some cart in that. each cart has some feature. i want to define a cart class and create new object of that with button using jquery.
I am new in laravel.
I found, i can use #include for use cart in my code,but i cant change parameter of that.
How can i do that?
Main.blade.php:
<div class="col-md-6">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#AddGorohkary">add</button>
</div>
<div class="row" >
<div class="col-md-12" >
<ul class="horizontal-slide" dir="ltr" >
#include("Panel")
</ul>
</div>
</div><!-- row -->
Panel.blade.php:
<li class="col-md-3" >
<div class="panel panel-primary" >
<div class="panel-heading">
<div class="row">
<div data-toggle="tooltip" data-placement="bottom" title="حذف این گروه کاری" class="col-md-1 col-sm-1 col-xs-1 col-lg-1 col-md-offset-1">
<button onclick=" remove_entry($(this).parent().parent().parent().parent());" style="color: black;" type="button" class="close" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<div data-toggle="tooltip" data-placement="bottom" title="تنظیمات" class="col-md-1 col-sm-1 col-xs-1 col-lg-1">
<span data-toggle="modal" data-target="#SettingModal" dir="rtl" style="color: black;" class=" glyphicon glyphicon-cog " aria-hidden="false"></span>
</div>
<div data-toggle="tooltip" data-placement="bottom" title="باز کردن صفحه گروه کاری" class="col-md-1 col-sm-1 col-xs-1 col-lg-1">
<a style="color: black;" href='/SpecialGoruhKary'><span class='glyphicon glyphicon-export' aria-hidden="false"></span></a>
</div>
<div data-toggle="tooltip" data-placement="bottom" title="اضافه کردن دانش آموز جدید" class="col-md-1 col-sm-1 col-xs-1 col-lg-1">
<span style="color: green;" class="glyphicon glyphicon-plus" aria-hidden="false"></span>
</div>
<div class="col-md-5 col-sm-5 col-xs-5 col-lg-5">
<span>#yield("GorohKarbariName")</span>
</div>
</div>
</div>
<div class="panel-body" style=" overflow-y: scroll;" >
#yield("table_body")
</div>
</div>
</li>
<!---------------------------------- Modal ---------------------------------------------------->
<div id="SettingModal" class="modal fade" role="dialog">
<div class="modal-dialog modal-lg">
<!-- Modal content-->
<div class="modal-content">
<div dir="rtl" class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title ">مشخصات این گروه کاری</h4>
</div>
<div class="modal-body">
<form dir="rtl" class="form-horizontal" action="{{ url('image-upload') }}" enctype="multipart/form-data" method="post" id="viewGorohkaryForm" >
{{ csrf_field() }}
<!-- Text input-->
<div class="form-group">
<div class="col-md-5 col-md-offset-3 inputGroupContainer">
<div dir="ltr" class="input-group">
<input dir="rtl" id="GorohKaryName" name="GorohKaryName" placeholder="اسم گروه کاری" class="form-control" type="text">
<span class="input-group-addon"><i class="glyphicon glyphicon-tag"></i></span>
</div>
</div>
<label for="GorohKaryName" class="col-md-2 control-label">اسم گروه کاری <span style="color: red">*</span> </label>
</div>
<!-- Text input-->
<div class="row col-md-offset-3">
<div class="form-group col-md-3">
<div class=" inputGroupContainer">
<div class=" clockpicker" data-placement="left" data-align="top" data-autoclose="true">
<div dir="ltr" class="input-group">
<input id="ValidTime" type="text" class="form-control" value="08:00">
<span class="input-group-addon">
<span class="glyphicon glyphicon-time"></span>
</span>
</div>
</div>
</div>
</div>
<div class="form-group col-md-4 ">
<div class=" inputGroupContainer">
<div dir="ltr" class="input-group col-md-offset-1">
<select style="direction: rtl;" class="form-control" id="day" name="day" required="required">
<option value="" data-hidden="true">روز هفته</option>
<option value="0">شنبه</option>
<option value="1">یکشنبه</option>
<option value="2">دوشنبه</option>
<option value="3">سه شنبه</option>
<option value="4">چهارشنبه</option>
<option value="5">پنجشنبه</option>
<option value="6">جمعه</option>
</select>
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
<div class="form-group col-md-2">
<div class=" inputGroupContainer">
<div dir="ltr" class="input-group">
<button type="button" class="btn btn-info btn-sm">
<span class="glyphicon glyphicon-plus"></span>
</button>
</div>
</div>
</div>
<label for="ValidTime" class="col-md-2 control-label" >زمان معتبر<span style="color: red">*</span> </label>
</div><!-- row clock-->
</form>
</div><!---modal body--->
<div class="modal-footer">
<button id="CreateNewGorohkary" type="submit" class="btn btn-warning" data-dismiss="modal">ذخیره <span class="glyphicon glyphicon-save"></span></button>
</div>
</div><!-- modal content-->
</div>
</div>
You can use of Including Sub-Views section of this link.
In that link you can see how send parameter to an include page.

Categories