resting

resting

Member Since 4 Years Ago

Experience Points 1,480
Experience Level 1

3,520 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 16
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • start-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-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-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist 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.

20 Feb
1 year ago

resting left a reply on Does Alias Work Only Work In View Templates?

Cool that works. But why does it need to be used as\VuforiaApi when other aliases doesn't need the backlash? (like Cache)

resting started a new conversation Does Alias Work Only Work In View Templates?

I have a Facade class:

namespace App\Facades;

use Illuminate\Support\Facades\Facade;

class VuforiaApiFacade extends Facade
{
    protected static function getFacadeAccessor()
    {
        return 'VuforiaApi';
    }
}

I register the alias VuforiaApi with:

'VuforiaApi' => App\Facades\VuforiaApiFacade::class,

Tried to call a method from controller:

VuforiaApi::delete_from_vuforia_and_s3($m);

throws Class 'App\Http\Controllers\VuforiaApi' not found

I had to call the full path to the Facade:

use App\Facades\VuforiaApiFacade;
...
VuforiaApiFacade::delete_from_vuforia_and_s3($m);

However calling a method in view template works fine

@php
dd(VuforiaApi::d());
@endphp

So alias only works in view templates?

31 Jan
1 year ago

resting started a new conversation How Do You Generate Links?

Do you guys use the link_to helper to generate links? (https://laravel.com/docs/4.2/helpers) Why is it not stated in 5.2 doc? (https://laravel.com/docs/5.2/helpers) Does Laravel's doc only document features for that particular version?

Are we supposed to go through all the documentation of versions below 5.2 assuming I'm using 5.2?

Thanks!

25 Nov
1 year ago

resting started a new conversation How To Manage Migration Of Db Content With Existing Data?

I have to make some changes to the permissions the users has for example. Using entrust here.

So I basically have to remove the old permissions and attach a new one.

I think I need a migration script and is wondering if there is a mechanism in Laravel to track these kinds of changes just like how DB schema changes are tracked in migration files etc.

18 Nov
1 year ago

resting started a new conversation How To Build This Relationships Tree With Eloquent?

Say I have a Admin role, who can create other Admins. An Admin can create Editors. Each Admin can only manage the Editors they created. An Editor can create posts. An Admin who created the Editor, as well as the Editors who created the posts can manage it.

I imagine there's a tree relationship here, and not sure how to go about building Eloquent relationships.

Is it like a User hasAndBelongsToMany Users? Something like that?

24 Apr
2 years ago

resting left a reply on Question About Building Relationships

Wow. It actually works.

And it's better than query builder cause it returns Items objects instead of a standard object.

Nice. Thanks.

resting left a reply on Question About Building Relationships

It kinda works, but I don't have flatMap probably because I'm at 5.2.

So now I need to pass off the query to a paginator and this is what I have:

Auth::user()->projects()->with('items')->orderBy('updated_at', 'desc')->paginate($limit)

But I think it's paginating the projects instead of items. See screenshot of dd() result: http://i.imgur.com/DsCC7be.jpg

Think I have to make items the main subject instead of `projects' somehow.

Maybe it's not possible with relationships. Probably will have to use query builder.

resting started a new conversation Question About Building Relationships

I have 3 tables. Users, Projects, Items. There's also a Pivot Table Project_User for the many-to-many relationship between projects and users.

So I can get projects assigned under the logged in user like: Auth::user()->projects()->get(). This is working fine.

Items belongsTo one project.

Now I'm not sure how to build the relationship so that I can retrieve the items similar to how I get the projects. Something like: Auth::user()->items()->get().

Option 1: I can get all the projects associated with the user first, then iterate everyone to get the items. I don't like this cause I think it should be possible to do it in one step?

Options 2: Somehow I can build a relationship or query in User.php to get access directly to items? This is the part I'm not sure of.

So I realise mine is a typical hasManyThrough pivot table problem. Doesn't seem like there's a good solution around.