sagar001

sagar001

Member Since 3 Years Ago

Bacheli, India

Experience Points
1,030
Total
Experience

3,970 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
0
Lessons
Completed
Best Reply Awards
0
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 1
1,030 XP
Sep
22
1 day ago
Activity icon

Started a new Conversation Laravel Component Problem.

A input component below

<input 
	class="w-full px-3 py-2 text-sm leading-tight text-gray-700 border-2 rounded shadow-sm 
	@error($name) border-red-500 @enderror appearance-none focus:outline-none focus:shadow-outline" 
	
	name="{{$name}}" 
	
	id="{{$name}}" 
	
	@if(isset($user))
		value="{{$user->$name}}" 
	@else
		value="Enter Your {{value}}"
	@endif
	
	required

	{{ $attributes->merge(['autocomplete' => '']) }}
>

And calling this component in other page like this.

<x-input type="email" name="email" :user="$user" autocomplete="email"></x-input>

and getting output like below

<input 
	class="w-full px-3 py-2 text-sm leading-tight text-gray-700 border-2 rounded shadow-sm appearance-none focus:outline-none focus:shadow-outline" 
	name="email" 
	id="email" 
	value="[email protected]" 
	required="" 
	autocomplete="email" 
	type="email" 
	user="{id:19,username:sagar,email:[email protected],email_verified_at:null,created_at:2020-09-22T11:0	32.000000Z,updated_at:2020-09-22T11:02:32.000000Z}"
>

Problem is... if i add $attributes variable in my component file than $user variable also added => user="{id:19,username:sagar,email:[email protected],email_verified_at:null,created_at:2020-09-22T11:0 32.000000Z,updated_at:2020-09-22T11:02:32.000000Z}". I want to add $attribute variable beacuse sometimes we need to add autocomplete attribute to input tag. How can we solve this problem?

Activity icon

Replied to Laravel Components Error

I already use has($header), count($header), isEmpty($header). Is there any method we can use to know the variable is defined or not.

Activity icon

Started a new Conversation Laravel Components Error

I am trying to make a panel component. the code is like below.

<div>
<header>
	{{ $header }}
</header>
<section>
	{{ $slot }}
</section>
<footer>
	{{ $footer }}
</footer>
</div>

The problem is that when i am calling this component i need to pass all three variable and if i don't pass all variable there is an undefined variable exception.

Anybody know how to make it more dynamic.

Activity icon

Replied to Password Setter Problem

Thats Works @wilk_randall . Thanks @thewebartisan7 and @frankielee , @wilk_randall for responding.

Sep
21
2 days ago
Activity icon

Replied to Password Setter Problem

haha.. now its not working on register route.

Activity icon

Replied to Password Setter Problem

@frankielee thanks man.. it doesn't hash the password when i am registering but when i am trying to save the password from edit page. The string password saved to database without hash.

Activity icon

Replied to Password Setter Problem

Thanks @thewebartisan7 and @frankielee but got same problem. when i am registering password hashed twice.

Sep
20
3 days ago
Activity icon

Replied to Password Setter Problem

How can i write a conditional in this case.

  1. Request sent from register page doesn't need bcrypt method beacuse laravel automatically bcrypt the password.
  2. Request sent from edit page needs bcrpyt method because its a string.

One needs and other doesn't. If I put this method on the user model and register than the password bcrypted twice.

Activity icon

Started a new Conversation Password Setter Problem

when I register setter method's bcrypt function change the password.

public function setPasswordAttribute($value)
{
	return $this->attributes['password'] = bcrypt($value);
}

Anyone know how to solve this problem. Keeping the method and doesn't change the password

Sep
19
4 days ago
Activity icon

Replied to How To Pass Somevalue To Pagination Links

I foundout this method is this correct method and tell me someone how to user that data inside the pagination page

{{ $product->links('vendor.pagination.tailwind',['show'=>'false']) }}
Activity icon

Started a new Conversation How To Pass Somevalue To Pagination Links

Anybody know about passing boolean value with pagination link.

{{ $product->links('vendor.pagination.tailwind') }}
Sep
03
2 weeks ago
Activity icon

Started a new Conversation Dropzone Double Instance Problem

I want to show each image width & height inside the thumbnail of dropzone and its also work if i drop only one file in the dropzone. But as soon as I drop 2nd image, the 2nd image dimensions are showing in the both thumbnail and if I again drop another image the 3rd image dimensions showing in all thumbnail.

I have this logic in my dropzone init method.

init: function () {
	this.on("thumbnail", function(file, xhr, formData){
		$('dimension').text(file.width+' x '+file.height);
	});
}

and also i have span tag in my thumbnail preview template

<span class="dimension"></span>

Any thought or idea will help. Thanks in advanced :)

Activity icon

Awarded Best Reply on Validation Problem

Thankyou @snapey and @michaloravec I find the answer by trial and error. I change the condition inside the if statement. Now code running okay.

$width < 1080 || $height < 1080
Activity icon

Replied to Validation Problem

I already used this approach at first. The problem in this code is, both min_width=1080 and min_height=1080 must be true to pass the validation.

Activity icon

Replied to Validation Problem

Thankyou @snapey and @michaloravec I find the answer by trial and error. I change the condition inside the if statement. Now code running okay.

$width < 1080 || $height < 1080
Sep
02
3 weeks ago
Activity icon

Started a new Conversation Validation Problem

I am Trying to validate the dimension of an image.. if either width or height is greater or equals to 1080px i need to pass the validation.. but my code is not working properly.. can someone point out where is the mistake.. Thanks in advanced :)


$validator = \Validator::make($request->all(), [
'file' => ['bail','required','image','mimes:jpeg,jpg,png',
        'max:2048',
        function ($attribute, $value, $fail) use ($request){
            list($width,$height) = getimagesize($request->file('file'));
            if($width > 1080 && $height > 1080) {
                $fail($attribute . ' must be at least 1080 in any direction');
            }
        }
        ],
]);
Aug
08
1 month ago
Activity icon

Replied to Call To Undefined Method App\Article::tags() Error

Thanks Geordie Jackson.. that worked :)

Activity icon

Started a new Conversation Call To Undefined Method App\Article::tags() Error

When i am passing data to this method i am getting "Call to undefined method App\Article::tags()". In my article model there is a method

protected function tags()
{
	return $this->belongsToMany(Tag::class);
}

and in my articleController i have this method

public function store(Request $request)
{
        $validatedAttribute = request()->validate([
            'title'     => 'required',
            'excerpt'   => 'required',
            'body'      => 'required'
        ]);

        $article = new Article($validatedAttribute);
        $article->user_id = 1;
        $article->save();

        $article->tags()->attach(request('tags'));

        return redirect('/article');
}

Anybody just tell me what i am doing wrong here.. Thanks :)

Apr
12
5 months ago
Activity icon

Awarded Best Reply on Export Array Into An Excel File.

Done

Activity icon

Started a new Conversation Export Array Into An Excel File.

Hello Guys.. I have array data like this...

{ [0]=> { 
	[0]=> { [0]=>"India" [1]=> "IND" [2]=> "1999" [3]=> "Data1" }
	[1]=> { [0]=> "India" [1]=> "IND" [2]=> "2000" [3]=> "Data2" } 
	[2]=> { [0]=> "India" [1]=> "IND" [2]=> "2001" [3]=> "Data3" } 
	[3]=> { [0]=> "India" [1]=> "IND" [2]=> "2002" [3]=> "Data4" } 
	[4]=> { [0]=> "India" [1]=> "IND" [2]=> "2003" [3]=> "Data5" } 
	[5]=> { [0]=> "India" [1]=> "IND" [2]=> "2004" [3]=> "Data6" } 
	[6]=> { [0]=> "India" [1]=> "IND" [2]=> "2005" [3]=> "Data7" }
}

I want to export this data to excel file like this...

| India | Data1 | Data2 | Data3 | Data4 | Data5 | Data6 |

if anybody can write some basic code for this.. Thanks in advanced :)