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 Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    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 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 its 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.

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.