pnoeric

pnoeric

Software Engineer at Eric's Ponyhof

Member Since 2 Months Ago

Los Angeles (but now I'm in Z├╝rich)

Experience Points
130
Total
Experience

4,870 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
130 XP
Aug
25
2 months ago
Activity icon

Replied to Laravel Nova Showing No Data - Related To Table Name/field Names?

And, I was able to fix it by changing this:

    public function fields(Request $request)
    {
        return [
            ID::make('ID', 'ID')->sortable(),
        ];
    }

So... two questions:

  1. I assume this is an issue because my ID column is uppercase in the DB schema instead of lowercase. Is there a more better way to go about this? (No way Nova can just grab the name of the ID column from the db?)

  2. More importantly: I am concerned about having DB column names and table names in two different places (my Laravel User resource as well as my main Eloquent User model). To add the 'Email' field, I already had to change this chunk of code:

            Text::make('Email', 'Email')
                ->sortable()
                ->rules('required', 'email', 'max:254')
                ->creationRules('unique:myCustomUsersTable,email')
                ->updateRules('unique:myCustomUsersTable,email,{{resourceId}}'),

It just seems very... bad... to have something like the table name buried in a string in a PHP method call (where even phpStorm can't see it for refactoring). Is there any elegant way to get around this?

Activity icon

Started a new Conversation Laravel Nova Showing No Data - Related To Table Name/field Names?

Hmm I'm not sure what's wrong, I JUST started with Laravel Nova and I can't get it to display my users table. :-(

The Eloquent model for Users is set up correctly; in tinker I can enter User::first() and that works fine. I see data, it's all good. (In fact I have seeded the table fully using standard Laravel factory/seeder procedure.)

But the screen is totally blank in the interface. I see rows and each of them just has a '-'. Clicking the "view" icon on any row returns a 404.

In my Nova/User.php file, I have public static $model = \App\Models\User::class; which is correct.

I suspect this is related to my non-standard table and column names. (Yes I know that's not fun, and no I can't change them; I'm forced to use an existing DB structure.)

But again, my Eloquent model is set up correctly (specifying the correct DB $table in the model so it functions). And in the Nova/User resource file, I've even simplified things so I can just see a list of IDs:

    public function fields(Request $request)
    {
        return [
            ID::make()->sortable(),
        ];
    }

The ID column in my db is named 'ID' (caps) and I've specified that in the Eloquent model (protected $primaryKey = 'ID';).

Help :-(

Aug
24
2 months ago
Activity icon

Replied to Create Nova User On Custom User Table

Same problem here-- Nova setup assumes the 'Users' table is configured a certain way. Mine isn't. ;-) Thanks @ciberman for the tip to set it up in Boot.

Aug
18
2 months ago
Activity icon

Replied to Is There A Callback For Migrate:fresh?

Hmmm custom command, good idea. Thanks!

Activity icon

Started a new Conversation Is There A Callback For Migrate:fresh?

Part of my seeding process is to create a bunch of static files that go in a folder in my project... but when I use migrate:fresh, I need to get rid of all those static files. Is there a way to hook into the migrate command, so I can have a helper function delete them?

(Also, side note: what's this forum software?! Custom-built? It's really fun.)