Mbrown1431

Mbrown1431

Member Since 7 Months Ago

Experience Points
10,750
Total
Experience

4,250 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
102
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 3
10,750 XP
Aug
01
1 week ago
Activity icon

Replied to Laravel - Collection Of Routes With Modification From Str::of

Thank you Braunson. I simply couldn't find the file with that code in it to reference. I got it working in like 5 min after reviewing that file of route list commands, which for a newbie, is pretty swell. Appreciate the pointer.

Activity icon

Started a new Conversation Laravel - Collection Of Routes With Modification From Str::of

I'm digging my way through the Helpers in the Laravel docs. I thought I'd tool around with getting all routes and modifying some of them with helpers and then display them on a table. It is functioning, however I'd like to modify the $routeMiddleware to only contain characters after the '@' symbol. Currently it displays something like:


Facade\Ignition\Http\Controllers\[email protected]__invoke

Since it is an array, I can't seem to find the proper technique or helper to complete the task as I get an error for array to string conversion. General guidance here for the proper method to do this would be appreciated.

Thanks!


use Illuminate\Support\Str;

class Api
{
    /**
     * Return all the registered routes.
     *
     * @return \Illuminate\Http\JsonResponse
     */
    public function getRoutes()
    {
        $routes = collect(Route::getRoutes())->map(function ($route, $index) {
            $routeName = $route->action['as'] ?? '';
            if (Str::endsWith($routeName, '.')) {
                $routeName = '';
            }

            $routeMiddleware = $route->action['middleware'] ?? [];
            $routeMiddleware = (Str::of($routeMiddleware)->after('@'));
            if (! is_array($routeMiddleware)) {
                $routeMiddleware = [$routeMiddleware];
            }

            return [
                'uri' => $route->uri,
                'as' => $routeName,
                'methods' => $route->methods,
                'action' => $route->action['uses'] ?? '',
                'middleware' => $routeMiddleware,
            ];
        });

        return response()->json($routes);
    }
}

Jul
26
2 weeks ago
Activity icon

Replied to Confused By / VS \ VS //

Thank you Ollie_123. I'm still frankly confused on something that seems basic.

Take this example:

'rootNamespace'=>'App\\', 'paths'=>[ 'models'=>'Models', 'repositories'=>'Repositories\\Eloquent', 'interfaces'=>'Contracts\\Repositories', 'transformers'=>'Transformers', 'presenters'=>'Presenters' 'validators' => 'Validators', 'controllers' => 'Http/Controllers', 'provider' => 'RepositoryServiceProvider', 'criteria' => 'Criteria',
Jul
25
2 weeks ago
Activity icon

Started a new Conversation Confused By / VS \ VS //

Just learning PHP and tinkering (pun intended) with Laravel. I've been looking at using a repository pattern to keep things cleaner. I'm confused reading docs between / VS \ VS //

What doc source am I missing? I feel like I've missed a chapter somewhere along my very short journey.

Thanks!

Jun
11
2 months ago
Activity icon

Replied to A Beginners Question About Cleaning Up Controller

Ishra,

Thank you! I don't know how I missed the scopes topic in the docs. Probably, because I'm still learning...everything. I really appreciate the information and tips. That explanation was very simple to understand, so thanks for keeping it on my level. I love the nullable timestamps, gonna be changing that practice up from now on.

Activity icon

Started a new Conversation A Beginners Question About Cleaning Up Controller

Hello,

I'm just tinkering around with building a blog from scratch. I have the below code in my PostController, however I'd like to migrate the db queries to the model. Any guidance how I can accomplish this? A link to docs is fine, just trying to learn.

Here is my controller code:

    $posts = Post::where('is_featured', '==', 0, 'and', 'featured_lead', '==', 0)->latest()->paginate(5);
    $featuredPosts = Post::where('is_featured', '==', 1, 'and', 'featured_lead', '==', 0)->limit(2)->take(2)->latest()->get();
    $featuredLeadPosts = Post::where('featured_lead', '==', 1, 'and', 'is_featured', '==', 1)->take(1)->limit(1)->latest()->get();
    return view('pages.blog.index', compact('posts', 'featuredPosts', 'featuredLeadPosts'));
Feb
18
5 months ago
Activity icon

Replied to Tips On Streamlining CSS

Thank you, I will check out PurgeCSS as well. Appreciate the tip!

Activity icon

Replied to Tips On Streamlining CSS

Thanks John!

I played around a bit and read a portion of the docs. This is exactly what I was hoping for, I just couldn't quite articulate what I wanted. It is lightweight and the components feature is precisely what I had in mind for streamlining basics that have already become repetitive.

Feb
17
5 months ago
Activity icon

Started a new Conversation Tips On Streamlining CSS

Disclaimer: I'm totally new to all of this. Started 3 weeks ago.

I have practiced and become quite comfortable writing semantic HTML5, DRY CSS and have the intermediate features of SCSS down. I can create a full page using CSS Grid, Flexbox and custom CSS with expected results, fully responsive and 100% CSS coverage.

I played around with Bootstrap today for the first time, and I hate it.

Is there a way to streamline SCSS development time? I saw an article on Compass, but that seems dead now. Any guidance would be appreciated. Maybe your preferred tools and methods?

Thanks!

Mike