Associate Laravel Developer at Rigel Networks Vadodara
Member Since 2 Years Ago
bhavnagar
3,780 experience to go until the next level!
In case you were wondering, you earn Laracasts experience when you:
Earned once you have completed your first Laracasts lesson.
Earned once you have earned your first 1000 experience points.
Earned when you have been with Laracasts for 1 year.
Earned when you have been with Laracasts for 2 years.
Earned when you have been with Laracasts for 3 years.
Earned when you have been with Laracasts for 4 years.
Earned when you have been with Laracasts for 5 years.
Earned when at least one Laracasts series has been fully completed.
Earned after your first post on the Laracasts forum.
Earned once 100 Laracasts lessons have been completed.
Earned once you receive your first "Best Reply" award on the Laracasts forum.
Earned if you are a paying Laracasts subscriber.
Earned if you have a lifetime subscription to Laracasts.
Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.
Earned once you have achieved 500 forum replies.
Earned once your experience points passes 100,000.
Earned once your experience points hits 10,000.
Earned once 1000 Laracasts lessons have been completed.
Earned once your "Best Reply" award count is 100 or more.
Earned once your experience points passes 1 million.
Earned once your experience points ranks in the top 50 of all Laracasts users.
Earned once your experience points ranks in the top 10 of all Laracasts users.
Started a new Conversation Trigger Not Working On Jquery Click Event
hii guys
i want when i want click to button then change as per value dynamically but everytime i click then show first value not change value as per click
here is my code
$(".edit_sidebarCollapse").on('click',function(){
var key_content = $(this).text();
var key_value = $.trim(key_content);
$('.summernote').summernote({
toolbar: [
// [groupName, [list of button]]
['style', ['style']],
['font', ['bold', 'underline', 'clear']],
['fontname', ['fontname']],
['color', ['color']],
],
height: 250,
code: key_value,
// focus: true
});
// $(".edit_sidebarCollapse").trigger('change');
});
$(".edit_sidebarCollapse").trigger('change');
});
i try trigger change but not working
Started a new Conversation How To Initialize Value In Summernote Editor
hii guys
i want to initialize value of summernote when i click button then show me value in summernote editor but not working in my condition please suggest how to do it
here is my code
$(document).ready(function() {
var key_value = $("#key_value");
console.log(key_value);
// $(".summernote").summernote("code", "#key_value");
$('.summernote').summernote({
toolbar: [
// [groupName, [list of button]]
['style', ['style']],
['font', ['bold', 'underline', 'clear']],
['fontname', ['fontname']],
['color', ['color']],
],
height: 250,
code: key_value,
// focus: true
// $(".summernote").code("#key_value");
});
});
Started a new Conversation ErrorException : Array And String Offset Access Syntax With Curly Braces Is Deprecated
when i try to run command in command prompt they got me error like ErrorException : Array and string offset access syntax with curly braces is deprecated
any php version error or someting i miss any file i dont know please help me
Started a new Conversation How To Aws S3 Bucket To File Transfer Local Directory Using Laravel
hii
i have files in aws server and i want to all files transfer to local directory in my project and also download so how can i do it?
Replied to How To Excel File Export With Client Name?
@sinnbeck yes i try in my computer its create file with colon but in my excel create function not working so its possible or not?
Replied to How To Excel File Export With Client Name?
@sinnbeck yes its working thank you
but i have one more issue can you please help me
current i export file then filename like "Self TPV lead verification - ABC Energy Illinois 12-17-2020 07_31 AM.xlsx"
in file name time is like now print 07_31 but i want 7:31 so :(colon ) is not supported in maatwebsite excel laravel?
i use this format
$currentDateTime = Carbon::now();
$currentDateTime->format('m-d-Y H:i A');
Started a new Conversation How To Excel File Export With Client Name?
hello guys i want to export my excel file with client name its dynamic so how to do it?
here is my code
Excel::create(config('constants.scripts-new-name.'.$script_id),
function($excel) use ($excelArray,$state,$language,$finalArr) {
if(isset($excelArray) && count($excelArray) >0)
{
$excel->sheet($state." ".strtoupper($language), function($sheet) use ($excelArray)
{
$sheet->fromArray($excelArray);
$sheet->setWidth(array(
'A' => 80,
'B' => 10,
'C' => 10,
'D' => 20,
'E' => 30
));
});
}
foreach($finalArr as $k => $v)
{
$excel->sheet(strtoupper($k), function($sheet) use ($v)
{
$sheet->fromArray($v);
$sheet->setWidth(array(
'A' => 80,
'B' => 20,
'C' => 10,
'D' => 20,
'E' => 30
));
});
}
})
->download("xlsx");
Started a new Conversation Array And String Offset Access Syntax With Curly Braces Is Deprecated
try to local to ftp report generate then error like
Array and string offset access syntax with curly braces is deprecated
here is my code
$rrhExcelSheet = Excel::create($fileName, function($excel) use ($sheetData) {
$excel->sheet('sheet1', function($sheet) use ($sheetData)
{
$sheet->fromArray($sheetData);
});
})->string('xlsx');
Replied to Datatable Not Showing Data
anyone know i m stuck in only january month record not display and all other months data display perfect but only january month data not display
Replied to Which Country Support DST Timezone In Php ?
@sinnbeck thank you for reply
my client send me details like
What is Daylight Saving, and in which countries it is applicable?
so futher i dont write any code for this just know which countries is support DST?
Started a new Conversation Which Country Support DST Timezone In Php ?
which country can support DST(daylight saving) timezone in php and how to convert UTC to DST timezone in php
Started a new Conversation What Is Difference Between Timezone & SetTimezone In Php
hello guys i want to set timezone in my project but i dont know about timezone so can you help me what is timezone and set timezone difference
Replied to SetTimezone Issue
@tisuchi its not working on yesterday leads
here is my query any suggestion where my mistake
$yesterdayLeads = $this->getConversionRateData(Carbon::parse(Carbon::now()->startOfDay()->subDays(1),$timezone)->setTimezone('UTC'), Carbon::parse(Carbon::now(),$timezone)->setTimezone('UTC')->startOfDay()->subDays(1)->addDays(1), $clientId,$salesCenterId, $locationIds,$brand);
Replied to SetTimezone Issue
Replied to SetTimezone Issue
@tisuchi thank you for response sir
but i just need in this query i dont create middleware for this so any solution for this query only
Started a new Conversation SetTimezone Issue
hello i m stuck in settimezone in my query can you please help me how to do it?
here is my query
$todayLeads = $this->getConversionRateData(Carbon::now()->startOfDay(), Carbon::now()->startOfDay()->addDays(1), $clientId,$salesCenterId, $locationIds,$brand);
how to settimezone in my query
Replied to How To Download Apk File On Laravel?
return response()->download($pathToFile, $name, $headers);
but download() function will tell the client to download the file from the web server so the path of your file must point to “public” folder of your website. But if your files are protected and you want your Laravel application to send the file, then use this snippet
return response()->file($path ,[
'Content-Type'=>'application/vnd.android.package-archive',
'Content-Disposition'=> 'attachment; filename="android.apk"',
]) ;
for more details check this link https://stackoverflow.com/questions/37539260/laravel-response-send-android-apk-file
Replied to Php Items Search With Photo
Replied to Hoe To Store Image From Webcam Into Database?
For uploading the image using web cam you just have to create the image and get the values of variables which are set to the flash code.and at the time of getting the image ,you just have to create the image insted of using any get or post method.something like that:
$fileext='jpeg';
$timestamp=md5(time());
$filename="photo".$timestamp.".".$fileext;
also more details try this link
https://stackoverflow.com/questions/13585714/capture-image-from-webcam-and-store-in-database-in-php
Replied to DateTime Returning Different Value When Time Is Zero
@jamols09 try this
{{ Carbon\Carbon::createFromFormat('d/m/Y', $vehicle_request->date_needed)->format('d-m-Y') }}
Replied to How Do I Print Just The Form Portion?
here we example in stackoverflow
https://stackoverflow.com/questions/468881/print-div-id-printarea-div-only
@media print {
body * {
visibility: hidden;
}
#section-to-print, #section-to-print * {
visibility: visible;
}
#section-to-print {
position: absolute;
left: 0;
top: 0;
}
}
Replied to How Do I Print Just The Form Portion?
Then add an event like an onclick (as shown above), and pass the id of the div like I did above.
function printDiv(divName) {
var printContents = document.getElementById(divName).innerHTML;
var originalContents = document.body.innerHTML;
document.body.innerHTML = printContents;
window.print();
document.body.innerHTML = originalContents;
}
Replied to How To Enum Datatype Using Multiple Values Store?
^ array:1 [▼
0 => array:12 [▼
"email" => "[email protected]"
"phone" => null
"alert_level" => "client"
"client_id" => "102"
"salescenter_id" => null
"location_id" => null
"alert_for" => "fraudalert,disposition"
"added_by" => 348
"added_for_client" => "102"
"type" => "email"
"created_at" => "2020-10-27 09:57:15"
"updated_at" => "2020-10-27 09:57:15"
]
]
Started a new Conversation How To Enum Datatype Using Multiple Values Store?
hii i have column like datatype is enum and also store multiple value like comma seperated so is it possible to store ?
here is my code i try but i cant find any solution
here is my migrations
public function up()
{
Schema::table('fraud_alerts', function (Blueprint $table) {
$table->enum('alert_for',['disposition','fraudalert'])->after('type')->nullable()->comment('Alert For');
});
}
here is my controller code
public function store(Request $request){
$requestData = $request->all();
foreach($requestData['email'] as $i => $list){
$data = array();
$all = ['fraudalert','disposition'];
$rowdata = array();
if(in_array("all",$requestData['email_alert_for'])){
$rowdata['alert_for'] = implode(',' , $all);
}else{
$rowdata['alert_for'] = $requestData['email_alert_for'];
}
array_push($data,$rowdata);
FraudAlert::insert($data);
}
}
i try but everytime store null value in alert_for column
Replied to Default Multiselect Dropdown Checkbox Not Working
@jay_chauhan ok so i want client name when page refresh default select client name display but in my case not working so how can i get this client name
here is my ajax response
$.each(response.data.salescenters, function(key,value){
var vid = value.id;
var conNumToString = vid.toString().split("");
if(response.data.selectedsalescenters){
var salesArray = '';
if(alertLevel == "salescenter"){
salesArray = response.data.selectedsalescenters.split(',');
}else if(alertLevel == "sclocation"){
salesArray = response.data.selectedsalescenters.split(',');
}
}
if(Array.isArray(salesArray) && salesArray.indexOf(conNumToString) !== 1){
console.log('1');
$("#edit-location-"+splitData[2]).append('<option value='+ value.id +'>'+ value.name +'</option>').prop('selectedIndex',salesArray).trigger('change');
}
else{
console.log('2');
$("#edit-location-"+splitData[2]).append('<option value='+ value.id +'>'+ value.name +'</option>').trigger('change');
}
$("#edit-location-"+splitData[2]).multiSelect('refresh'); // init the select
Replied to How To Get Auth::user()->id In JWT Api ?
@martin20 let try this
// the token is valid and we have find the user via the sub claim
$user = JWTAuth::parseToken()->authenticate();
$userId = $user->id;
hope its work for you
Started a new Conversation Select Option Css Change And Like Input Textbox
hii i have one select dropdown and i want css like this dropdown like textbox input field so how can i do it
here is my code
<div class="form-group sales-location-enabled">
<select class="form-control location-select-class" name="locations[]" multiple="multiple" >
<option value="{{$client->id}}">{{$client->name}}</option>
</select>
</div>
Replied to How To Fetch Multiple Selected Checkbox In Dropdown Using Jquery
anyone suggestion for this issue ?
Started a new Conversation How To Fetch Multiple Selected Checkbox In Dropdown Using Jquery
dropdown edit time not fetch selected value checked in jquery dropdown always return last selected element how to fetch selected checked value in dropdown
here is my code
$(document).on('change','.edit-alert-select-class',function(){
var eid = $(this).attr('id');
var splitData = eid.split("-");
var fid = $("#fid-"+splitData[2]).val();
var alertLevel = $( "#edit-level-"+splitData[2]+" option:selected" ).val();
if(alertLevel != 'client')
{
$.ajax({
type:'POST',
data:{'_token':'{{csrf_token()}}','alertLevel': alertLevel,'clientId':'{{$client->id}}','fid': fid},
url:"{{route('findclientsalescenter')}}",
success:function(response){
$("#edit-location-"+splitData[2]).empty();
$.each(response.data.salescenters, function(key,value){
var vid = value.id;
var conNumToString = vid.toString().split("");
if(response.data.selectedsalescenters){
var salesArray = '';
if(alertLevel == "salescenter"){
salesArray = response.data.selectedsalescenters.split(',');
}else if(alertLevel == "sclocation"){
salesArray = response.data.selectedsalescenters.split(',');
}
}
if(Array.isArray(salesArray) && salesArray.indexOf(conNumToString) !== 1){
console.log('1');
$("#edit-location-"+splitData[2]).append('<option value='+ value.id +'selected>'+ value.name +'</option>').trigger('change');
}
else{
console.log('2');
$("#edit-location-"+splitData[2]).append('<option value='+ value.id +'>'+ value.name +'</option>').trigger('change');
}
$("#edit-location-"+splitData[2]).multiSelect('refresh'); // init the select
});
// $("#edit-location-"+splitData[2]).multiSelect('refresh'); // init the select
}
});
}
});
Started a new Conversation Default Multiselect Dropdown Checkbox Not Working
hii guys i have question like i have multiselect checkbox dropdown in value fetch using append but when i page refresh then default select "client Level" not working can you suggest how to do it?
here is my code
$("#emaillocation-"+splitData[1]).empty();
$("#emaillocation-"+splitData[1]).append('<option value="{{$client->id}}"> {{$client->name}} </option>').attr("checked","checked").trigger('change');
$("#emaillocation-"+splitData[1]).multiSelect('refresh');
Replied to How To Array To Update Multiple Rows
i do it my self resolved issue thank for support @silencebringer @sinnbeck
elseif(!empty($requestData['edit_email']) && count($requestData['edit_email']) > 0){
foreach($requestData['edit_email'] as $i => $list){
$ids = array();
$ids = $requestData['fid-'.($i+1)]; //current id
$editrow['email']=$requestData['edit_email'][$i];
$editrow['phone'] = NULL;
switch($requestData['edit_email_alert_level'][$i]){
case 'client':
$editrow['alert_level'] = "client";
$editrow['client_id'] = (!empty($requestData['edit_locations-'.($i+1)])) ? implode("," ,$requestData['edit_locations-'.($i+1)]) : NULL;
$editrow['salescenter_id'] = NULL;
$editrow['location_id'] = NULL;
break;
case 'salescenter':
$editrow['alert_level'] = "salescenter";
$editrow['client_id'] = NULL;
$editrow['salescenter_id'] = (!empty($requestData['edit_locations-'.($i+1)])) ? implode("," ,$requestData['edit_locations-'.($i+1)]) : NULL;
$editrow['location_id'] = NULL;
break;
case 'sclocation':
$editrow['alert_level'] = "sclocation";
$editrow['location_id'] = (!empty($requestData['edit_locations-'.($i+1)])) ? implode("," ,$requestData['edit_locations-'.($i+1)]) : NULL;
$editrow['client_id'] = NULL;
$editrow['salescenter_id'] = NULL;
break;
default:
break;
}
FraudAlert::where('id',$ids)->update($editrow);
}
}
Replied to How To Array To Update Multiple Rows
array:6 [▼
"_token" => "sTUoBilbfwZfp0x6tSdZhB4S5YQTO7l0xlip0QzA"
"clientId" => "102"
"fid" => array:2 [▼
0 => "228"
1 => "231"
]
"edit_email" => array:2 [▼
0 => "[email protected]"
1 => "[email protected]"
]
"edit_email_alert_level" => array:2 [▼
0 => "sclocation"
1 => "client"
]
"edit_locations" => array:2 [▼
0 => "12"
1 => "3"
]
]
this type of array i need to update for each id so how can i do it
Replied to How To Array To Update Multiple Rows
@sinnbeck i have field like email, alert_level, select
in which its alert_level fields like client/salescenter/location and select field like depend on alert_level
when i update all three fields then its not working like its multiple times
Replied to How To Array To Update Multiple Rows
@silencebringer @sinnbeck i use whereIn() but in case when i update data then old data save and new data also add so not remove old and replace new data
Replied to How To Array To Update Multiple Rows
@silencebringer so how can i do it can i remove $id?
Started a new Conversation How To Array To Update Multiple Rows
hii i m stuck in array through update my records i have array set in which i update multiple rows so how can i do it here is my code
if(!empty($requestData['edit_email']) && count($requestData['edit_email']) > 0){
foreach($requestData['edit_email'] as $i => $list){
$ids = array();
$editdata = array();
array_push($ids,$requestData['fid']);
$editrow['email']=$requestData['edit_email'][$i];
$editrow['phone'] = NULL;
// dd($requestData['edit_email_alert_level']);
switch($requestData['edit_email_alert_level'][$i]){
case "0":
$editrow['alert_level'] = "client";
$editrow['client_id'] = (!empty($requestData['edit_locations'])) ? implode("," ,$requestData['edit_locations']) : NULL;
$editrow['salescenter_id'] = NULL;
$editrow['location_id'] = NULL;
break;
case "1":
$editrow['alert_level'] = "salescenter";
$editrow['salescenter_id'] = (!empty($requestData['edit_locations'])) ? implode("," ,$requestData['edit_locations']) : NULL;
$editrow['client_id'] = NULL;
$editrow['location_id'] = NULL;
break;
case "2":
$editrow['alert_level'] = "sclocation";
$editrow['location_id'] = (!empty($requestData['edit_locations'])) ? implode("," ,$requestData['edit_locations']) : NULL;
$editrow['salescenter_id'] = NULL;
$editrow['client_id'] = NULL;
break;
default:
break;
}
}
array_push($editdata,$editrow);
FraudAlert::where('id', $ids)->update($editdata);
// dd($ids);
// dd($requestData['fid']);
}
when i update record then error
SQLSTATE[42S22]: Column not found: 1054 Unknown column '0' in 'field list' (SQL: update fraud_alerts
set 0
= [email protected], updated_at
= 2020-10-15 05:23:31 where id
= 222)
Started a new Conversation Replace Select2 To Input Text Dynamic
hii i have dropdown like client/sales/location and anthor dropdown is dependent to previous one like when i select client then other dropdown fetch value to client level table when i select sales then fetch value to other dropdown in sales table
in case of when i select client then i have only one value so when i select client level then remove other dropdown and add input box to replace select2 dropdown how it possible?
here is my code
$(document).ready(function(){
$('.location-select-class').multiSelect();
$(document).on('change','.alert-select-class',function(){
var eid = $(this).attr('id');
var splitData = eid.split("-");
let alertLevel = $(this).val();
if(alertLevel != 'client')
{
$.ajax({
type:'POST',
data:{'_token':'{{csrf_token()}}','alertLevel': alertLevel,'clientId':'{{$client->id}}'},
url:"{{route('findclientsalescenter')}}",
success:function(response){
$("#emaillocation-"+splitData[1]).empty();
$.each(response.data, function(key,value){
$("#emaillocation-"+splitData[1]).append('<option value='+ value.id +'>'+ value.name +'</option>').trigger('change');
$("#emaillocation-"+splitData[1]).multiSelect('refresh');
});
}
});
}
else
{
$("#emaillocation-"+splitData[1]).empty();
$("#emaillocation-"+splitData[1]).append('<option value="{{$client->id}}"> {{$client->name}} </option>').prop("selected","selected").trigger('change');
$("#emaillocation-"+splitData[1]).multiSelect('refresh');
}
});
});
i want input box in else condtion so replace select and add input in else condition how to do it
Replied to Remove Class In Not Working
@a4ashraf i try both the scenario but in this case remove first time perfect but second time i click to remove then all option will removed can you please suggest more example?
Replied to Remove Class In Not Working
@a4ashraf yes how to do it
i have code inside
<div class="col-xs-12 col-sm-12 col-md-12 removecloned-email" id="removed_email">
//html
</div>
i remove whole div id remove email class