rohit_mg

Member Since 1 Year Ago

Experience Points
16,650
Total
Experience

3,350 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
153
Lessons
Completed
Best Reply Awards
1
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.

  • Community Pillar

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

Level 4
16,650 XP
May
05
3 days ago
Activity icon

Replied to Laravel 8 At Sub-directory - 404 Error Issue

Have a look at this https://laravel-news.com/subfolder-install

Also what kind of hosting are you on? VPS or shared hosting? on a VPS there are some tweaks you can make to your apache or nginx config to do this

Activity icon

Awarded Best Reply on Xml To Mysql

Yes, I think this follows the basic idea I detailed above

inside the while loop $row is set from an xml record
	in the nested for loops, $record iterates over each COMPONENTE_AIUTO child
		inside the loops, initialize $recordXML, 
		fields before COMPONENTE_AIUTO from $row 
		fields after COMPONENTE_AIUTO from $record
		save the record and repeat the loop.

This way the outer values from $row are repeated for each child COMPONENTE_AIUTO

Activity icon

Replied to Xml To Mysql

Yes, I think this follows the basic idea I detailed above

inside the while loop $row is set from an xml record
	in the nested for loops, $record iterates over each COMPONENTE_AIUTO child
		inside the loops, initialize $recordXML, 
		fields before COMPONENTE_AIUTO from $row 
		fields after COMPONENTE_AIUTO from $record
		save the record and repeat the loop.

This way the outer values from $row are repeated for each child COMPONENTE_AIUTO

May
04
4 days ago
Activity icon

Replied to Xml To Mysql

If i understand you correctly you are trying to save xml data with the structure:

{
"col-1" : a,
"col-2" : b,
"col-3" : [{
	"col-4": c,
	"col-5": d,
	},{
	"col-4": e,
	"col-5": f,
	}]
}

into a database of the form

a  b  c  d
a  b  e  f

one way to accomplish this would be to create 2 arrays of the keys of the root object and "col-3" object

	$keys_1 = ["col-1" "col-2"];
	$keys_2 = ["col-4" "col-5"];
    
	$new_row = new DBModel();
	foreach($keys_1 as $k){
		$new_row->$k = $xml[$k];
	}
	foreach($xml["col-3"] as $data){
		foreach($keys_1 as $k){
			$new_row->$k = $xml[$k];
		}
		$new_row->save();
	}

Hope this helps!

Activity icon

Replied to Image(logo) Not Display Using Condition.

I think your issue is if there is no data from the database, then the for loop doesn't get executed.

Perhaps you could try something like

@if($data['logos'])
	@foreach($data['logos'] as $logo)
		<img alt="" src="{{ url('storage/images/'.$logo->logo) }}" style="width:50px;height:50px;">
	@endforeach
@else
	<img alt="" src="{{ asset('img/logo.png')  }}" style="width:50px;height:50px;">
@endif
May
01
1 week ago
Activity icon

Replied to Needed Help For Query

For sales by seller 1

	$sales = Sale::where('seller_id', 1)->get();

For sales by each seller

	$sales = Sale::all()->groupBy('seller_id');

For sum of all quantity of each day of each product

	$sales = Sale::all()->groupBy('action_date')->groupBy('product_id')->sum('quantity');
Activity icon

Replied to Parsing Data To Javascript With Laravel Controller

You are using Livewire right? dispatchBrowserEvent only works with Livewire or AlpineJS

Activity icon

Replied to How To Display Url Like This Http://127.0.0.1:8000/staff/scheduler/edit/2/2

in your view, check weather $staffSchedulesDays is an array. put an @dd($staffSchedulesDays) before the 'a' tag and see what comes out. if it is an array, you might have to change your code to, depending on the structure of the array

<a href="{{ route('staff.scheduler.edit',[$s->id , $staffSchedulesDays[0]]) }}" class="btn btn-primary" title="@lang('messages.edit')">

Activity icon

Replied to Counts On One To Many To Many

define a hasManyThrough relation from Competency to Users. So your Competency Model should have a function like

public function users()
    {
        return $this->hasManyThrough(User::class, RequiredUserLevel::class);
    }

then in your controller

    $competency = Competency::with('users')->get();

	$competency_user_count = [];
	foreach($competency as $k => $c){
			$competency_user_count[$k] = count($c->users);
	}

https://laravel.com/docs/8.x/eloquent-relationships#has-many-through

Activity icon

Replied to Laravel Spatie Permission

have you tried either of these

$role->givePermissionTo($permission);
$permission->assignRole($role);

they aren't artisan commands, but you should be able to run it in a controller or in tinker so that the relevant Spatie roles and permissions tables are updated

Nov
26
5 months ago
Activity icon

Replied to Navigate To Certain Parts Of The Page Using # In URL In VueJS

Not sure about with Vue since you havent shared any details about your code, but you should be able to get this to work by adding the id="response223" to the div in question.

Note the url will be https://www.example.com/conversations#response223 to navigate to the div directly ( without the "/" before the required div's id )