van1310

van1310

Associate Laravel Developer at Rigel Networks Vadodara

Member Since 1 Year Ago

bhavnagar

Experience Points
43,070
Total
Experience

1,930 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
151
Lessons
Completed
Best Reply Awards
20
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    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.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 9
43,070 XP
Jul
08
2 days ago
Activity icon

Replied to Serverside Validation Not Working

@deepu07 ok where are you from and give some information to so i can connect you

Activity icon

Replied to Search By Month

@40codebr

if ($request->has('month')) {
	$month = $request->input('month');
	Chamados::whereRaw('MONTH(created_at) = '.$month)->get();
}
Jul
06
4 days ago
Activity icon

Started a new Conversation Unparenthesized `a ? B : C ? D : E` Is Deprecated. Use Either `(a ? B : C) ? D : E` Or `a ? B : (c ? D : E)`

here is my blade file

<label class="col-form-label col-lg-3 col-sm-6 border-right">
 	{{ isset($employee_data->employee_pay_type)?(($employee_data->employee_pay_type == 1)?'Client DDP':(($employee_data->employee_pay_type == 2)?'ATF':($employee_data->employee_pay_type == 3)?'S3V!N Shipped Check':'S3V!N DDP')):'' }}
</label>
Jul
03
1 week ago
Activity icon

Replied to PAGE NUMBER

@krishma

The answer, as I discovered, is simply to put any required loop in the view, not in the controller

Jul
01
1 week ago
Activity icon

Replied to Error On Email Validation

@nakov i change this method its working but not display error message

Activity icon

Started a new Conversation Error On Email Validation

Hii When i try to check mail is valid or not using ajax getting error

syntax error, unexpected 'if' (T_IF), expecting ']'

here is blade file code

<input type="email" class="form-control m-input checkmail">

$.validator.addMethod("checkEmail", 
    	function() {           
        		$.ajax({
            		headers: {
                			'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            	},
              	url: "{{route('admin.company.checkmail')}}",
              	method: 'post',                  
              	data: {
                 		company_email: jQuery('#checkmail').val(),
              	},
              	success: function(data){
                    	if($.isEmptyObject(data.error)){
                        		alert(data.success);
                    	}
                    	else{
                        		printErrorMsg(data.error);
                    	}
                	}                
            	});
        	}, 
    );

here is my controller

public function checkmail(Request $request)
	{
    	$user_data = CompanyOnboardingForm1::select('user_id','created_tab_no')->where('id', $request->id)->first();

    $validator = Validator::make($request->all(),[
        if(empty($request->id)) {
            'company_email' => 'required|email|unique:users,email,NULL,NULL,deleted_at,NULL',            
        } else {               
            'company_email' => 'required|email|unique:users,email,' . $user_data->user_id . ',id,deleted_at,NULL',
        }
    ]);

    if ($validator->passes()) {
        return response()->json(['success'=> true ]);
    }
    return response()->json(['error'=>$validator->errors()->all()]);
}

here is my route

Route::post('company/checkmail','[email protected]')->name('admin.company.checkmail');
Jun
26
2 weeks ago
Activity icon

Replied to Serverside Validation Not Working

@deepu07

i try someting like that but error Undefined variable: rules_add

 $validator = \Validator::make($request->all(),[
            function ($rules_add) use ($request){
                $rules_add = array();
                if(empty($request->id)) {
                    $rules_add = [
                        'company_name' => 'required|max:80', 
                        'company_country' => 'required', 
                        'company_state' => 'required', 
                        'company_city' => 'required', 
                        'company_email' => 'required|email|unique:users,email,NULL,NULL,deleted_at,NULL',
                    ];
                    } else {
                        $rules_add = [
                            'company_email' => 'required|email|unique:users,email,' . $user_data->user_id . ',id,deleted_at,NULL',
                        ];
                    }
                }
        ]);
Activity icon

Replied to Serverside Validation Not Working

@deepu07 thank for sharing but i dont understand how to implement can you please give some brer example to do it

Activity icon

Started a new Conversation Serverside Validation Not Working

hii guys,

i have form which client side validation working but serverside validation not working

here is my controller

public function store(Request $request)
	{
	$tab = (isset($request->formName) && $request->formName == 'kt_form_company') ? 1 : 2;  
	
	$rules = [
            	//not-required Fields
            	'alt_id_number1' => 'nullable|numeric|min:0',
            	'company_zip' => 'nullable',
            	'fica_taxrate_pct' => 'nullable|numeric|min:0|max:100',
            	'futa_taxrate_pct' => 'nullable|numeric|min:0|max:100',
            	'suta_taxrate_pr_state_pct' => 'nullable|numeric|min:0|max:100',
            	'suta_taxrate_charger_pr_state_pct' => 'nullable|numeric|min:0|max:100',
            	'futa_taxrate_surcharge_pr_state_pct' => 'nullable|numeric|min:0|max:100',
            	'enrollment_fee' => 'nullable|numeric|min:0|max:999999999999',
            	'deposite' => 'nullable|numeric|min:0|max:999999999999',
            	'claim_reimbursement' => 'nullable|numeric|min:0|max:999999999999',
            	'claim_reimbursement_stop_loss' => 'nullable|numeric|min:0|max:999999999999',
            	'claim_reimbursement_stop_loss_broker_action_price' => 'nullable|numeric|min:0|max:999999999999',
            	'cost_pr_live_payroll_check' => 'nullable|numeric|min:0|max:999999999999',
           		 'cost_pr_atf_payroll_check' => 'nullable|numeric|min:0|max:999999999999',
            	'charge_pr_payroll_check' => 'nullable|numeric|min:0|max:999999999999',
            	'shipping_fee' => 'nullable|numeric|min:0|max:999999999999',
            	'return_payroll_fee' => 'nullable|numeric|min:0|max:999999999999',
            	'direct_deposit_fee_pr_emp' => 'nullable|numeric|min:0|max:999999999999',
            	'charge_pr_emp_w2' => 'nullable|numeric|min:0|max:999999999999',
            	'aca_fee_pr_billable_emp_wage_hr' => 'nullable|numeric|min:0|max:999999999999',
            	'non_submission_of_emp_i9_pr_emp_fee' => 'nullable|numeric|min:0|max:999999999999',
            	'non_submission_of_emp_new_hire_info_pr_emp_fee' => 'nullable|numeric|min:0|max:999999999999',
           		'garnishment_fee' => 'nullable|numeric|min:0|max:999999999999',
            	'non_submission_of_emp_benefits_decline_frm_pr_emp_fee' => 'nullable|numeric|min:0|max:999999999999',
            	'non_submission_of_serious_injury_doc_in_full' => 'nullable|numeric|min:0|max:999999999999',
            	'non_submission_of_injury_doc_in_full' => 'nullable|numeric|min:0|max:999999999999',
        	];

$this->validate($request, $rules);
	
	if ( empty($request->id) )
        	{
            ## Insert Record
            	$company = $request->only( $cols );
            	$company['alt_id_number'] = $request->alt_id_number1;
            	$company['client_payroll_tax_cut_offs_cr'] = (int) $request->has('client_payroll_tax_cut_offs_cr');
            	$company['safety_reimbursement'] = (int) $request->has('safety_reimbursement');
            	$company['min_ann_wcpc_for_safety_incentive_qualif'] = (int) $request->has('min_ann_wcpc_for_safety_incentive_qualif');
            	$company['created_tab_no'] = 1;
            	$company['company_owner_email'] = $request->company_email;

            	$userInActive = Helper::createUserWithRole([
                		'first_name' => $request->company_name,
                		'email' => $request->company_email,
                		'active' => '0',
            	],'employer');                   

            $res = CompanyOnboardingForm1::create($company);

            return Redirect::route('admin.company')->with('msg_success',__('message.insertSuccess',['page'=>'Prospective Client']));
        	}
    }

any suggest how to do it?

Jun
24
2 weeks ago
Activity icon

Replied to How To Secure File Uploads?

@martinbean sorry sir i dont meant it

Jun
22
2 weeks ago
Activity icon

Replied to How To Secure File Uploads?

@coding_field if you like my answer then click on best anwser

Jun
18
3 weeks ago
Activity icon

Replied to How To Store Multiple Values?

@ramlashkar

may be save method outside in foreach loop

foreach ($$lrId['rows'] as $row) {
    	$challan_manifesto_routes = new challanManifestoRoute([
        	'mLrId' => $row['mLrId'],
        	'chId'  => $chId,
        	'rmNo'  => $rmNo,
    	]);        
	}
$challan_manifesto_routes->saveMany();
Jun
16
3 weeks ago
Activity icon

Replied to Does Laravel 7 Have A Multi Auth Package?

@rrrr then create a user table in field user_role and insert user_role like "admin" and "user" then using laravel query separate it

Jun
12
4 weeks ago
Activity icon

Awarded Best Reply on Display Dyanamic Message Using Json

i fix solution my self using laravel localiztion

here is my code

in blade file

{{__('message.deleteSuccess',['page'=>'Claim'])}}

also create resource/lang folder --message.php

'deleteSuccess' => 'Delete :page sucessfully!'

to send dynamic message

Activity icon

Replied to Display Dyanamic Message Using Json

i fix solution my self using laravel localiztion

here is my code

in blade file

{{__('message.deleteSuccess',['page'=>'Claim'])}}

also create resource/lang folder --message.php

'deleteSuccess' => 'Delete :page sucessfully!'

to send dynamic message

Activity icon

Started a new Conversation Display Dyanamic Message Using Json

hii guys.

i have one message function in js that i used for display message for "Claim Delete successfully" same as other data but its static now i can run dynamic so how to do it using json data

here is my code

 function delClaim(claim_id) {
    	swal.fire({
        		title:"Are you sure you want to delete this claim?",
        		text: "You won't be able to revert this!" ,
        		type:"warning",
        		showCancelButton:!0,
        		confirmButtonText:"Yes, delete it!"})
        		.then(function(e){
            		e.value &&
            		$.ajax({
                			headers: {
                    			'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                			},
                		url:"{{url('admin/company/claim/destroy')}}/"+claim_id,
                		method:"DELETE",
                		type:"json",
                		data:{'id':claim_id},
                		success:function (res) {
                    	if(res.result == true)
                        		swal.fire("Deleted!", 'Claim deleted successfully.', "success").then(function() {
                            	dtbl_claim.ajax.reload();
                        	});
                    	else
                        		swal.fire("Error!", res.messages, "fail");
                		}
            	});
        	});
	}

Thanks

Mar
19
3 months ago
Activity icon

Replied to Filter Using Dropdown In Jquery

i try this but data value null can anyone suggest how my mistake

here is my blade code

<select class="form-control bootstrap-select" name="projectName" id="kt_form_type" >
    	@foreach($projectName as $list)
           		<option value="{{$list}}">{{$list}}</option>
   		@endforeach
</select>

here is my js code

$(document).ready(function() {
	var table =  $('#scrolling_horizontal').DataTable();
 		$('#kt_form_type').on('change', function () {
                	datatable.columns(2).search( this.value ).draw();
            } );                
});
Activity icon

Started a new Conversation Filter Using Dropdown In Jquery

here is my blade code

<select class="form-control bootstrap-select" name="projectName" id="kt_form_type" >
        	@foreach($projectName as $list)
               	<option value="{{$list}}">{{$list}}</option>
       	@endforeach
	</select>

//here is my datatable
<div class="kt-datatable" id="scrolling_horizontal"></div>

how to filter record using this dropdown help me

Mar
13
3 months ago
Activity icon

Replied to Maatwebsite/excel Not Working On Older Version Of Excel Sheet

anyone help how can i solved this i dont know my older version worksheet 97-2003 not woking in getComment how to solved this?

Activity icon

Started a new Conversation Maatwebsite/excel Not Working On Older Version Of Excel Sheet

hii i have issue for add comments on excel sheet its working fine in latest version of excel sheet but i try to export older version sheet not working

here is my code of export

public function registerEvents(): array
	{
    	return [
        	AfterSheet::class    => function(AfterSheet $event) {

            	$styleArray = [
                		'borders' => [
                    	'outline' => [
                        'borderStyle' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN, //BORDER_THICK,
                        'color' => ['argb' => 'FFFF0000'],
                    ]
                ]
            ];

            $i = 0;
            // $letters = range('A','ZZ');
            $letters = array();
            $letter = 'A';
            while ($letter !== 'AAA') {
                $letters[] = $letter++;
            }

            foreach ($this->row_no as $row) {
                // $event->sheet->getDelegate()->getColumnDimension($letters[$i])->setAutoSize(true);
                $event->sheet->getDelegate()->getStyle($letters[$this->column_no[$i]].$row)->applyFromArray($styleArray);
                $event->sheet->getDelegate()->getComment($letters[$this->column_no[$i]].$row)->getText()->createTextRun('User Id');
                $i++;
            }
        },
    ];
}
Mar
11
3 months ago
Activity icon

Started a new Conversation Set Column Value Dynamic Using Maatwebsite

hii guys i want dynamic cells comments generate so how to do it here is my static code

export function

public static function afterSheet(AfterSheet $event)
	{    	
    	$event->sheet->getDelegate()->getComment('B2')->getText()->createTextRun('User Name');
    	$event->sheet->getDelegate()->getComment('C2')->getText()->createTextRun('User Email');
	}

now the cell 'B2' & 'C2' static cells but i want generate dynamic cells to update comments

Activity icon

Replied to How To Add Comments In Maatwesite Excel Package

i can set comments static but now problem is that how to suppose i have lots of records in database so how to comments in all data using loop

here is my function

public static function afterSheet(AfterSheet $event)
	{
    	$event->sheet->getDelegate()->getComment('B2')->getText()->createTextRun('User Name');
    	$event->sheet->getDelegate()->getComment('C2')->getText()->createTextRun('User Email');
	}

actually cell B2 and C2 but when database add data into excel file automatice add comments particular cell

how can i make it?

Activity icon

Replied to How To Add Comments In Maatwesite Excel Package

i search on google and try it but no comments export in excel file

here is my Userexport.php

public function sheets(): array
	{
    	$event->sheet->getDelegate()->getComment('A1')->getText()->createTextRun('Your comment:');
	}

Controller file

public function export() 
	{
    	return Excel::download(new UsersExport, 'users.xlsx');
	}

simple file export no comments are exported into excel sheet

Activity icon

Replied to How To Add Comments In Maatwesite Excel Package

Any of know how to export with columns comments using excel maatwebsite pacakge

Activity icon

Started a new Conversation How To Add Comments In Maatwesite Excel Package

hi guys

how can i add excel tooltips in maatwebsite to export excel sheet help me

Feb
26
4 months ago
Activity icon

Started a new Conversation Modal Can't Working When Id Pass

when i pass id then modal can't be open so why my mistake

here is my code

@foreach($student as $list)
    <a href="#" data-toggle="modal" data-target="#modal_addpayment-{{$list->id}}" ></a>

    <div class="modal fade" id="modal_addpayment-{{$list->id}}" tabindex="-1" role="dialog" >
        //modal code
    </div>
@endforeach

can't open when i try to open in loop beacuse i open with id so that's why i pass id in modal but its not open

Feb
25
4 months ago
Activity icon

Replied to How To Image Upload Using Dropzone ?

@bobbybouwmann sir

here is my blade file code

<form action="{{url('dropzone/store')}}" method="POST" enctype="multipart/form-data">
{{csrf_field()}}
    <div class="dropzone dropzone-default dz-clickable" id="kt_dropzone_1">
                <div class="dropzone-msg dz-message needsclick">
                        <h3 class="dropzone-msg-title">Drop files here or click to upload.</h3>
                </div>
        </div>
    <button type="submit" class="btn btn-primary">Submit</button>
</form>

<script type="text/javascript">
        Dropzone.options.dropzone =
        {
            maxFilesize: 10,
            renameFile: function (file) {
                    var dt = new Date();
                    var time = dt.getTime();
                return time + file.name;
            },
            acceptedFiles: ".jpeg,.jpg,.png,.gif",
            addRemoveLinks: true,
            timeout: 60000,
            success: function (file, response) {
                console.log(response);
            },
            error: function (file, response) {
                    return false;
            }
        };
</script>

here is my controller

public function store(Request $request)
    {
        $image = $request->file('file');
        $avatarName = $image->getClientOriginalName();
        $image->move(public_path('images'),$avatarName);
     
        $imageUpload = new Image();
        $imageUpload->filename = $avatarName;
        $imageUpload->save();
        return response()->json(['success'=>$avatarName]);
    }

this is my js code

 $('#kt_dropzone_1').dropzone({
        url: "/store", // Set the url for your upload script location
        paramName: "file", // The name that will be used to transfer the file
        maxFiles: 1,
        maxFilesize: 5, // MB
        addRemoveLinks: true,
        accept: function(file, done) {
            if (file.name == "sign.jpg") {
                done("Naha, you don't.");
            } else {
                done();
            }
        }
    });
Feb
23
4 months ago
Activity icon

Replied to How To Image Upload Using Dropzone ?

@bobbybouwmann @jeffreyvanrossum i m using multiple fields to store with image so how to upload image with image name so how can i do it

Activity icon

Replied to How To Image Upload Using Dropzone ?

@jeffreyvanrossum but in my case i done already but when i check in controller $request->file('file'); then null no image fetch

Activity icon

Replied to How To Image Upload Using Dropzone ?

@bobbybouwmann sir i try this tutorial but when i try to submit using form in my html page design was change and try to return image null

Activity icon

Started a new Conversation How To Image Upload Using Dropzone ?

i dont know how to use js and upload image using dropzone

here is my code

<form action="{{route('sign.store')}}" method="POST" enctype="multipart/form-data" >
{{csrf_field()}}
<div class="col-lg-7 col-md-9 col-sm-12">
        <div class="dropzone dropzone-default dz-clickable" id="kt_dropzone_1">
                <div class="dropzone-msg dz-message needsclick">
                    <h3 class="dropzone-msg-title">Drop files here or click to upload.</h3>
        </div>
             </div>
         </div>
<input type="text" class="form-control" placeholder="Enter zodiac name">
<input type="submit">
</form>

here is my js file

var demo1 = function () {
        $('#kt_dropzone_1').dropzone({
                url: "https://keenthemes.com/scripts/void.php",
                paramName: "file",
            maxFiles: 1,
             maxFilesize: 5,
                addRemoveLinks: true,
                accept: function(file, done) {
                    if (file.name == "justinbieber.jpg") {
                            done("Naha, you don't.");
                    } else {
                            done();
                    }
                }
        });
Feb
22
4 months ago
Activity icon

Replied to Add Attributes To My Auth()->user Session

@jorge_dev96 try this

public function getUsernameAttribute($username)
    {
        return \Auth::attempt(array('username' => $username));
    }
Feb
21
4 months ago
Activity icon

Replied to Class 'Menu' Not Found

@litterec can you try this php artisan vendor:publish

Activity icon

Replied to Alert In Laravel

@heynibbi

controller file

public function usereditupdate(Request $request,$id) 
{
    $users= User::find($id);
    $users->name=$request->input('username');
        $users->usertype=$request->input('username');
    $users->update();
        return redirect('/user')->with('status',"Your Data Is Successfully Updated"); 
}

blade file

@if (isset(session('status')))
    {{session('status')}}
@endif