vandan

vandan

Laravel Developer at Byte and Bits At Ahmedabad

Member Since 1 Year Ago

bhavnagar

Experience Points
41,520
Total
Experience

3,480 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
18
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
41,520 XP
Mar
19
3 weeks 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 weeks 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
4 weeks 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
1 month 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
1 month 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
1 month 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
1 month 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
1 month 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
Feb
20
1 month ago
Activity icon

Replied to Help With Git

@deemo if solved your query then click to best answer

Activity icon

Replied to Help With Git

@deemo your .envfile store like .env.example so just remove .example then use it .env

also step to git use it

git init
git remote add origin https://[email protected]/Demo/demo.git
git add .
git commit -m "demo project"
git push -u origin master
Activity icon

Replied to Wildcard Subdomain Per User

@sinnbeck i m using ubuntu 18.4 version os

Activity icon

Replied to Wildcard Subdomain Per User

@sinnbeck yes

<VirtualHost *:80>

    ServerName pg.org

    ServerAlias *.pg.org

</VirtualHost>
Activity icon

Replied to Wildcard Subdomain Per User

@sinnbeck i m using localhost and i create virtualhost 127.0.0.1 pg.org

so is that correct way or wrong and my url like http://127.0.0.1:8000/

Activity icon

Replied to Wildcard Subdomain Per User

@sinnbeck yes add this line virtualhost after restart my apache server but same error page not found

Activity icon

Replied to Wildcard Subdomain Per User

@sinnbeck i dont know how to access subdomain i actaully sir create subdomain to new registered user using name that means username to create subdomain evry new user name is subdomain name with my website for example vandan.pg.org

Activity icon

Replied to Wildcard Subdomain Per User

@sinnbeck i try this but page not found error

see my code

Route::group(array('domain' => '{subdomain}.pg.org'), function () {
        Route::get('/', function ($subdomain) {
            $name = DB::table('users')->where('name', $subdomain)->get();
            dd($name);
        });
});
Activity icon

Started a new Conversation Wildcard Subdomain Per User

hii guys i want to create subdomain to every user create subdomain so how to do it?

Feb
19
1 month ago
Activity icon

Replied to Print Invoice To Pdf

@ikram_aurelie

try this using js

<script>
        function Export() {
            html2canvas(document.getElementById('kt_table_1'), {
            onrendered: function (canvas) {
                    var data = canvas.toDataURL();
                    var docDefinition = {
                        content: [{
                            image: data,
                            width: 500
                            }]
                    };
                    pdfMake.createPdf(docDefinition).download("pg.pdf");
                    }
            });
        }
</script>

<a href="#" class="kt-nav__link" id="btnExport" onclick="Export()"></a>
Activity icon

Replied to Scopes In Join

@sinnbeck not much idea but i found on google references like

https://ducktypelabs.com/using-scope-with-associations/

maybe its help you sir

Activity icon

Replied to How To Avoid Duplicate Values At The Time Of Update Query Using If And Else Condition In Laravel Controller

@krishma

function update(Request $request,$id)
{
    $fetch = Yourmodel::pluck('category_code');
    $category_code = $request->input('category_code');
        $category_desc = $request->input('category_desc');
        $modified_on = date('Y-m-d');
        $modified_by = 0;
        $data=array('category_code'=>$category_code,
            'category_desc'=>$category_desc,
            'modified_on'=>$modified_on,
            'modified_by'=>$modified_by);

        foreach($fetch as $list){
            if($list == $category_code){
                //no update
            }
            else{
                    DB::table('asset_category')->where('category_id',$id)->update($data);
            }           
        }
}
Feb
16
1 month ago
Activity icon

Awarded Best Reply on Can't Preview Vector Image(.ai)

@sinnbeck @sti3bas i solved this issue

in my controller first convert image into png after store in database

public function thumbGenerator(Request $request)
    {
        $file = $request->file('image');
        $imagename = str_random(30).'.'.'png';
        $image = new Imagick();
        $image->readImageBlob(file_get_contents($file));
        $image->setImageFormat("png24");
        $image->resizeImage(1024, 768, imagick::FILTER_LANCZOS, 1);         
        $image->writeImage($imagename);
    
        $user1 = new User(array(
                'name'=>'abc',
                'email'=>'[email protected]',
                'password'=>bcrypt('1234'),
                'photo'=>$imagename
        ));
        $user1->save();
        return view('welcome',compact('user1'));
    }
Activity icon

Replied to Can't Preview Vector Image(.ai)

@sinnbeck @sti3bas i solved this issue

in my controller first convert image into png after store in database

public function thumbGenerator(Request $request)
    {
        $file = $request->file('image');
        $imagename = str_random(30).'.'.'png';
        $image = new Imagick();
        $image->readImageBlob(file_get_contents($file));
        $image->setImageFormat("png24");
        $image->resizeImage(1024, 768, imagick::FILTER_LANCZOS, 1);         
        $image->writeImage($imagename);
    
        $user1 = new User(array(
                'name'=>'abc',
                'email'=>'[email protected]',
                'password'=>bcrypt('1234'),
                'photo'=>$imagename
        ));
        $user1->save();
        return view('welcome',compact('user1'));
    }
Feb
15
1 month ago
Activity icon

Started a new Conversation App\Http\Controllers\Spatie\PdfToImage\Pdf' Not Found

i try to convert pdf to image i use spatie/pdf-to-image package but when i excute then error Class 'App\Http\Controllers\Spatie\PdfToImage\Pdf' not found

here is my controller

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Input;
use Imagick;
use App\User;
use Image;
use PDF;

public function thumbGenerator(Request $request)
    { 
    $files=Input::file('image')->store('images');
    $pdf = new Spatie\PdfToImage\Pdf($files);
        $pdf->saveImage($pathToWhereImageShouldBeStored);

        $user = new User(array(
            'name'=>'abc',
                'email'=>'[email protected]',
                'password'=>bcrypt('123123'),
                'photo'=>$file,
        ));
        $user->save();
        return redirect()->back();
}
Feb
14
1 month ago
Activity icon

Replied to Can't Preview Vector Image(.ai)

@sinnbeck @sti3bas infinte random strings generate

Activity icon

Replied to Can't Preview Vector Image(.ai)

@sti3bas unable to open image `images/ozuW2q7P4vyOKWRYfNVHQ7snqwn0IDJbcrQ4cucL.pdf': No such file or directory @ error/blob.c/OpenBlob/2701

Activity icon

Replied to Can't Preview Vector Image(.ai)

@sti3bas ok t try also first store but not authorized `images/ewbd8h145Swaqy2Jn5hEdAbrinmrvIpMWi4Ms5E9.pdf' @ error/constitute.c/ReadImage/412

Activity icon

Replied to Can't Preview Vector Image(.ai)

@sti3bas ok i try and error this unable to open image `/tmp/phpc4xDaJ.ai': No such file or directory @ error/blob.c/OpenBlob/2701