sauravs012

sauravs012

Software Engineer at Chandigarh

Member Since 4 Months Ago

Chandigarh

Experience Points
7,510
Total
Experience

2,490 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
39
Lessons
Completed
Best Reply Awards
4
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 2
7,510 XP
Jun
07
1 month ago
Activity icon

Replied to Table Not Fit Inside Pdf Using DOPPDF Laibrary

fixed using

<table id="customermeta" width="100%" style="table-layout:fixed;">
Activity icon

Replied to How To Convert Html+css To Pdf

I've used DOMPDF laibray for generate PDF from html but table is not fit inside pdf using it. Table width stretches after PDF conversion...

Activity icon

Started a new Conversation Table Not Fit Inside Pdf Using DOPPDF Laibrary

I've used DOMPDF laibray for generate PDF from html but table is not fit inside pdf using it. Table width stretches after PDF conversion. Thank You!

Jun
05
1 month ago
Activity icon

Replied to How To Convert Html+css To Pdf

I have used this... Css not working perfectly there

Jun
04
1 month ago
Activity icon

Started a new Conversation How To Convert Html+css To Pdf

Hello buddies. I have used pdfdom to convert html + css to pdf but it's not converting perfectly. Help me if you have worked/fixed same type of functionality/issue. OR Is there any other laibrary which helps me to achieve this.

Thanks in Advance!!!

May
22
1 month ago
Activity icon

Replied to How To Generate Excel And Attach With Email?

I also need help with this issue..

May
21
1 month ago
Activity icon

Started a new Conversation Make Laravel Schedule Command Last Day Of Month At Time

I want to send list of users to admin on last day of month which are registered on current month. I've not any experience in laravel scheduling

May
08
2 months ago
Activity icon

Replied to Files Automatically Deletes

got the issue.. When I pull on server files are deleting... what i can do?

May
04
2 months ago
Activity icon

Replied to Files Automatically Deletes

Yes in the fresh Laravel

May
03
2 months ago
Activity icon

Started a new Conversation Files Automatically Deletes

In my App pictures are saved in storage/app/public, but somehow they are deleted automatically. Please let me know if you can help me to fix this. Thanks

Apr
19
2 months ago
Activity icon

Replied to Link On Another Page To Last Pagination URL [ SOLVED ]

you can use jQuery

$(".pagination li:last-child a").attr('href','CUSTOM URL HERE');
Apr
17
2 months ago
Activity icon

Replied to Take Backup Of Whole Website With Database

I want to take a backup in my local. For this I've run the command

php artisan backup:run

It returns

[33mStarting backup...[39m

[33mIn DbDumper.php line 148:[39m
[37;41m
       [39;49m
[37;41m  Too few arguments to function Spatie\DbDumper\DbDumper::setDumpBinaryP
ath()  [39;49m
[37;41m  , 0 passed in C:\xampp\htdocs\creafted\pluglist\vendor\spatie\laravel-
backu  [39;49m
[37;41m  p\src\Tasks\Backup\DbDumperFactory.php on line 88 and exactly 1 expect
ed     [39;49m
[37;41m
       [39;49m

Activity icon

Started a new Conversation Take Backup Of Whole Website With Database

Hi All, How I can take backup of my laravel files daily using cron job with database. Thanks in advance.

Mar
17
3 months ago
Activity icon

Replied to How To Pass The Route In Url Parameter In Jquery Ajax Call

you can get action attribute using HTML

<form action="{{route('ajax_input_store')}}">

jQuery

var Url = $(this).parents('form').attr('action');
url:Url, //ajax
Activity icon

Replied to How To Pass The Route In Url Parameter In Jquery Ajax Call

ah, I thought jquery is inline :)

Activity icon

Replied to PHP Error: Call To Undefined Method Illuminate/Events/Dispatcher::all()

In versions prior to Laravel 5.7, this method class name was fire but with Laravel 5.8, it is now dispatch.

Replace fire with dispatch in \Your Project\vendor\santigarcor\laratrust\src\Traits\LaratrustHasEvents.php from

    protected function fireLaratrustEvent($event, array $payload)
    {
        if (! isset(static::$dispatcher)) {
            return true;
        }

        return static::$dispatcher->fire(
            "laratrust.{$event}: ".static::class,
            $payload
        );
    }

to

    protected function fireLaratrustEvent($event, array $payload)
    {
        if (! isset(static::$dispatcher)) {
            return true;
        }

        return static::$dispatcher->dispatch(
            "laratrust.{$event}: ".static::class,
            $payload
        );
    }
Activity icon

Replied to How To Pass The Route In Url Parameter In Jquery Ajax Call

this way

url:"{{URL::route('ajax_input_store')}}"
Activity icon

Replied to Config Variable Not Updated - Laravel

use

\Config::get('custom_params.INSERTED_DATA');

at place of

Config::get('custom_params.INSERTED_DATA');
Mar
15
3 months ago
Activity icon

Replied to How Can I Pass Variable With Section In Main Layout File?

I've changed the code, but error is still same

@php
	$titleMeta = $category->meta_title;
	
	$descriptionMeta = $category->meta_description;
	
	$keywordsMeta = $category->meta_keywords;
	
	$created = $category->created_at;
	$updated = $category->updated_at;
	
	$imageURL = '/images/'.$category->image';
@endphp

@extends('layouts.app', ['titleMeta' => $titleMeta, 'descriptionMeta' => $descriptionMeta, 'keywordsMeta' => $keywordsMeta, 'created' => $created, 'updated' => $updated, 'imageURL' => $imageURL])

@section('content')
	<div class="container">
	</div>
@endsection

app.blade.php

<title>{{$titleMeta}}</title>
	<meta name="description" content="{{$descriptionMeta}}"/>
	<meta name="keywords" content="{{$keywordsMeta}}" />
Activity icon

Replied to How Can I Pass Variable With Section In Main Layout File?

hey @snapey I've tried, it works fine with 2 variables with in a section, but when I'm create third section it will return an error

2 variables

@section('test1', {{$content}}) @section('test2', {{$content2}})


3rd variable

@section('test3', {{$content3}})


ErrorException (E_ERROR)
syntax error, unexpected '<' (View: index.blade.php)
Previous exceptions
syntax error, unexpected '<' (0)
Activity icon

Replied to How Can I Pass Variable With Section In Main Layout File?

@sinnbeck , I've make a mistake while create discussion here, My code is same as you mentioned

@section('metatitle', {{$meta->title}})
Activity icon

Started a new Conversation How Can I Pass Variable With Section In Main Layout File?

Got this error while using @section('metatitle', {{$meta->title}) in index.blade.php

ErrorException (E_ERROR)
syntax error, unexpected '<' (View: index.blade.php)
Previous exceptions
syntax error, unexpected '<' (0)
Activity icon

Awarded Best Reply on Zoopla API

Thanks to all. I've created a new account on Zoopla, and API is working fine with new API.

Mar
13
3 months ago
Activity icon

Replied to Bootstrap Nested Tabs Not Working

class or id attribute not started with an integer, as you write in the code id="{{$sub->id}}-tab" and others

change it to id="tab-{{$sub->id}}" and all others like this

Activity icon

Replied to Add Profile Button

you did not use window.location in onclick attr. Try this

<button class="btn btn-primary" onclick="window.location='{{ url(profile/create") }}'">Add Profile</button>
Activity icon

Replied to Show Databases In Laravel

this will return all the databases

$tables = \DB::select('SHOW DATABASES');
dd($tables);
Mar
12
3 months ago
Activity icon

Started a new Conversation What Is The Use Of Composer Dump-autoload?

what is the use of composer dump-autoload ?

Mar
11
4 months ago
Activity icon

Replied to Validation Of Json File

Try

['file' => 'required|file|mimetypes:application/json']
Activity icon

Replied to Error Connecting Database

Some systems like Ubuntu, mysql is using by default the UNIX auth_socket plugin. Your problem will solved by setting the plugin value in user tables.

mysql> USE mysql;
mysql> UPDATE user SET plugin='mysql_native_password' WHERE User='root';
mysql> FLUSH PRIVILEGES;
mysql> exit;
$ service mysql restart
Mar
06
4 months ago
Activity icon

Replied to Access Denied For User

Try to start php artisan serve in new a port. cache will remove

php artisan serve --port=8080
Mar
04
4 months ago
Activity icon

Replied to PHP Notice: Undefined Variable: Threads In Psy Shell Code On Line 1

No need to use get()

public function index()
    {
        $threads = Thread::latest();

        return view('threads.index', compact('threads'));
    }

If you want a single record

public function index()
    {
        $threads = Thread::latest()->first();

        return view('threads.index', compact('threads'));
    }
Activity icon

Replied to How To Pass Array From Jquery Ajax To Php

use JSON.stringify to convert an array to string in jQuery

QB['Title']=title;
QB['Qtype']=Qtype;
QB['Parrent']=Parrent;
QB['Child']=Child;
QB['options']=option;
var myJSON = JSON.stringify(QB);


data:{QB:myJSON,function:'Save_Question'}

Use json_encode in your controller function

dd(json_decode($_REQUEST['QB']));
Feb
28
4 months ago
Activity icon

Replied to Drop Down Menu Not Expanding When Under Url With Parameters

You have to add active class using if current page route is equals to page route which you write in href

Feb
27
4 months ago
Activity icon

Awarded Best Reply on Laravel 6+ Upload Multiple Images Through A Form

There are various methods to do this. I've used below one, in which all images are store in a cell with implode(|). You have to change column type to text if you want to store all images in single column of a row

public function store(request $request) {

    $destinationPath = 'storage/veh-images' ; 
    $images=array();
    if($files=$request->file('vehimage')){
        foreach($files as $file){
            $filename=$file->getClientOriginalName();
            $file->move($destinationPath, $filename);
            $images[]=$name;
        }
    }
    //implode images with pipe symbol
    $allImages = implode("|",$images);

    $vehiclesmodel = new VehiclesModel ;
    $vehiclesmodel->vehmod = $request->vehmod ;
    $vehiclesmodel->vehmark = $request->vehmark ;
    $vehiclesmodel->vehyear = $request->vehyear ;
    $vehiclesmodel->vehengine = $request->vehengine ;
    $vehiclesmodel->vehtrans = $request->vehtrans ;
    $vehiclesmodel->vehimage = $allImages;

    $vehiclesmodel->save() ;
    return redirect('mypage')->with('success', 'The record has been added succesfully!') ;
}

You can also try with json

Feb
26
4 months ago
Activity icon

Replied to Unique Email Validation Using "unique:users,email"

You can make a custom rule, which will transform the user input to lower string when checking

create a new rule using php artisan command php artisan make:rule Lowercase and defined the rule.

app/Rules/Lowercase.php

public function passes($attribute, $value)
{
 return strtolower($value) === $value;
}

public function message()
{
    return 'The :attribute must be lowercase.';
}

RegisterController.php add new rule to email

use App\Rules\Lowercase;
protected function validator(array $data)
{
        return Validator::make($data, [
            'firstName' => 'required|string|max:255',
            'lastName' => 'required|string|max:255',
            'email' => [ 'required', 'string', 'email', 'max:255', 'unique:user,usrEmail', new Lowercase ],
            'password' => 'required|string|min:6|confirmed',
            'dataProtection' => 'required',
            'termsService' => 'required',
        ]);
Activity icon

Replied to How To Get POST Only Data In Laravel 6

Your code should be

$data = $request->request->get('form');
var_dump($data['name']);
Activity icon

Replied to Font Awesome Not Working With Laravel 6 ( Squares Only )

fontawesome.css doesn't declare any font-face, so that's why it isn't working. you can use Font Awesome's all.css which declares all font faces within its own CSS file.

@import '@fortawesome/fontawesome-free/scss/brands.scss';

Same issue: https://laracasts.com/discuss/channels/laravel/laravel-fontawesome-not-working-no-errors

Activity icon

Replied to Embed Form On Another Sites

You can achieve this by jQuery

$('#m').load('http://fiddle.jshell.net/qAa4u/show/light #1');

#m is the id of any element in which you want to display a form

http://fiddle.jshell.net/qAa4u/show/light is the url of your page where the form is

#1 is the id element of the form

Here is an example: http://jsfiddle.net/rn4Gy/

Activity icon

Replied to Landing Page To Be Login Page

use redirect over view

Route::get('/', function () {
    return Redirect::to('login');
});
Activity icon

Replied to Jsfiddle Example Of JQuery Isn't Applying On JQuery Code

Add below script before setMeetingCarausel() function

$('.create-meeting-btn, .create-task-btn').click(function(){
    $('.panel-body .row>div:eq(2)').slideToggle();
    $(this).parents('.panel-body').find('.row>div:eq(2)').slideToggle();
});
Feb
25
4 months ago
Feb
24
4 months ago
Activity icon

Replied to Get User ID By Access Token ?

@thoasty spamming ? :)

Activity icon

Replied to Get User ID By Access Token ?

$user_id = DB::table('oauth_access_tokens')->where('id', $user_token)->first(); echo $user_id->id;

Activity icon

Replied to Laravel 6+ Upload Multiple Images Through A Form

There are various methods to do this. I've used below one, in which all images are store in a cell with implode(|). You have to change column type to text if you want to store all images in single column of a row

public function store(request $request) {

    $destinationPath = 'storage/veh-images' ; 
    $images=array();
    if($files=$request->file('vehimage')){
        foreach($files as $file){
            $filename=$file->getClientOriginalName();
            $file->move($destinationPath, $filename);
            $images[]=$name;
        }
    }
    //implode images with pipe symbol
    $allImages = implode("|",$images);

    $vehiclesmodel = new VehiclesModel ;
    $vehiclesmodel->vehmod = $request->vehmod ;
    $vehiclesmodel->vehmark = $request->vehmark ;
    $vehiclesmodel->vehyear = $request->vehyear ;
    $vehiclesmodel->vehengine = $request->vehengine ;
    $vehiclesmodel->vehtrans = $request->vehtrans ;
    $vehiclesmodel->vehimage = $allImages;

    $vehiclesmodel->save() ;
    return redirect('mypage')->with('success', 'The record has been added succesfully!') ;
}

You can also try with json

Activity icon

Replied to Mcrypt PHP Extension Required

Had the same issue - PHP7 missing mcrypt.

This worked for me in Ubuntu Please try below commands.

sudo apt-get update
sudo apt-get install mcrypt php7.1-mcrypt
sudo apt-get upgrade

Then restarts apache

sudo service apache2 restart

Hope this commands helps!