roerjo

Software Engineer at Friendemic

Member Since 3 Years Ago

Asheville, NC

Experience Points
54,970
Total
Experience

30 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
511
Lessons
Completed
Best Reply Awards
4
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.

Level 11
54,970 XP
Sep
11
3 months ago
Activity icon

Commented on Prime Factors

It was just for 3

Aug
25
3 months ago
Activity icon

Commented on Refactoring To Controller Classes

A good code editor would have probably highlighted that as a possible error. Look into getting some PHP plugins for whatever code editor you are using.

Activity icon

Commented on Composer Autoloading

Ignoring the /vendor directory is a very good practice.

Also, in this project, I believe he setup the config.php to hold the hard-coded username and password for the database connection. You would also want to ignore this file in that case. If you didn't, then your username and password would be available for anyone to view at the location this repository is stored, e.g. GitHub.

Activity icon

Commented on Dynamic Inserts With PDO

join() is an alias of implode(), so yes you can use either. One argument for using implode over join is that the opposite function, explode() just sounds more paired to implode than `join'. But that is just my personal opinion.

https://www.php.net/manual/en/function.join.php

Activity icon

Commented on Forms, Request Types, And Routing

I believe it is good practice to declare class properties and give them default properties when practical. This allows the next developer to quickly scan the class and see what the properties and methods of that class are. If you omitted the $routes declaration, it is not obvious that there is an available routes property on the class unless you dig deeper into the methods and find out that get() and post() are setting that property.

Also, by omitting the declaration, you have lost the ability to restrict the visibility of the routes property. When you build it the way you did, the property is given a default visibility of 'public' instead of 'protected'.

Activity icon

Commented on Make A Router

I thought he did an amazing job presenting a complicated topic that has lots of interconnected pieces. It broke it down into it's parts to make it more digestible and this is similar to how a framework would implement a router. If you had trouble following along, then just watch it again and again until you grasp it.

Activity icon

Commented on Intro To PDO

After re-reading your question, I believe what you are looking for what Laravel calls Accessors/Mutators. You would need to use the magic method __set() and then within that method call a function to manipulate that value. Something like:

class User
{
    public function getName()
    {
        return ucwords($this->name);
    }

    public function setName($value)
    {
        // Do whatever it is you want to do to the value
        $this->name = $value;
    }

    public function __set($key, $value)
    {
        if ($key === 'name') {
            $this->setName($value);
        }
    }
}

This is just off the top of my head and would probably require some manipulation to work. Read the whole post of the link that I referenced in my previous comment to get a better handle on how PDO is setting up the class.

Activity icon

Commented on Intro To PDO

https://phpdelusions.net/pdo/objects#parameters

You can pass additional arguments to the fetchAll method to retrieve things in different ways and pass arguments to the constructor.

Aug
22
3 months ago
Activity icon

Commented on Feature: Forum Reputation Refactoring

What are the benefits of declaring the reputation values as constants instead of using a config file?

Jul
08
5 months ago
Activity icon

Replied to Login With Passport

@jorgealberto check out this thread: https://laracasts.com/discuss/channels/lumen/method-attempt-does-not-exist-or-auth-guard-driver-api-is-not-defined

Looks like attempt is not part of the 'api' guard and you should try using 'check` instead.

Activity icon

Replied to Login With Passport

Maybe try running php artisan config:clear . You may have cached you config prior to changing the auth.php file and it is reading that cached version instead.

Activity icon

Replied to Failed Asserting That Exception Of Type "\Exception" Is Thrown.

<?php

namespace Tests\Unit;

use Tests\TestCase;

class ExceptionTest extends TestCase
{
    /** @test */
    function test_exception()
    {
        $this->expectException(\Exception::class);

        throw new \Exception('blah');
    }
}

This test passes for me so there must be something else you haven't shown us.

Activity icon

Started a new Conversation Soft Delete On Specific Date

Anybody know of a way to have a model soft deleted on a passed in date rather than the current date/time? I want to call a soft delete which will trigger the deleted model event (which I have setup to cascade that soft delete to certain related models).

I suppose I could just use the QueryBuilder and call DB::table('blah')->where('id', $id)->update(['deleted_at' => {date_string}]);, but then I'll need to cascade that soft delete manually as well (and I also want that specific date to cascade).

It would be nice if I could just call $model->delete({date_string}); but it doesn't look like the delete() method accepts any params according to API docs.