topvillas

Member Since 6 Years Ago

Sandwich

Experience Points
220,955
Total
Experience

4,045 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
571
Lessons
Completed
Best Reply Awards
246
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.

  • Community Pillar

    Earned once your experience points ranks in the top 10 of all Laracasts users.

Level 45
220,955 XP
May
05
1 week ago
Activity icon

Replied to Incorrect Datetime Format

Carbon

May
02
2 weeks ago
Activity icon

Started a new Conversation Non Problem That's Bothering Me!

I'm using VSCode with the PHP Intelephense plugin.

When using a guard to login, using either the helper or facade ...

auth('admin')->attempt('xxx', 'xxx');

It gets all pissy about "attempt" being an undefined method. I know the helper returns a StatefulGuard but Intelephense won't have it.

At the end of the day, it works and isn't really a problem. But I'm a bit anal about stuff like this. Squiggly lines get on my nerves.

Any idea how to make everything play nicely?

Apr
26
2 weeks ago
Activity icon

Started a new Conversation Lazychaser Nested Set, Eager Loading Parent

Anybody else using lazychaser's nested set package? Did you have any problems eager loading a node's parent?

I've had a good look at the NodeTrait and it all looks fine to me. Ancestors and descendants load okay but for some reason, the belongsTo parent relationship just produces nothing, not even a null reference.

My query ...

        return Location::query()
            ->where('name', 'LIKE', "$term%")
            ->orwhere('slug', 'LIKE', "$term%$")
            ->with('parent')
            ->get();
```


Nested set's parent relationship ...
```
    public function parent()
    {
        return $this->belongsTo(get_class($this), $this->getParentIdName())
            ->setModel($this);
    }
```
Apr
23
3 weeks ago
Activity icon

Replied to Filling Inputs Alpine JS

It's Alpine, one of the simplest Javascript libraries there is. If you want to use it then learn how to use it.

It should take up fifteen minutes of your time on YouTube.

Activity icon

Replied to Filling Inputs Alpine JS

Set x-data to contain the company name, bind it to the input's HTML then set it when a value in the select is selected.

Apr
17
4 weeks ago
Activity icon

Awarded Best Reply on Eloquent Relationships Between Services In Microservice Architecture

Don't overthink it, just call the products microserive from the orders microservice.

But don't forget to cache the products.

Activity icon

Replied to Eloquent Relationships Between Services In Microservice Architecture

Don't overthink it, just call the products microserive from the orders microservice.

But don't forget to cache the products.

Apr
09
1 month ago
Activity icon

Awarded Best Reply on Lumen Microservices, Service Using API Gateway's Database Configurations

Are you using Windows?

I had a similar issue a while ago and from what I could tell, it's a problem with Apache on Windows.

I solved it by putting the database configuration straight into the config file (not ideal by any stretch).

Apr
08
1 month ago
Activity icon

Replied to Lumen Microservices, Service Using API Gateway's Database Configurations

Are you using Windows?

I had a similar issue a while ago and from what I could tell, it's a problem with Apache on Windows.

I solved it by putting the database configuration straight into the config file (not ideal by any stretch).

Apr
07
1 month ago
Activity icon

Replied to Laravel + Vue.js + ? 😅 (what's Best Practice ?)

Vuetify isn't a CSS framework, it's a component library that uses material design.

Tailwind isn't really a framework either, it's a utility based library which just takes a lot of the grind out of using CSS.

If you're just mucking about with ideas as a learning exercise then use Bootstrap.

Mar
17
1 month ago
Activity icon

Replied to Class 'Redis' Not Found

Do you have the PHP extension installed?

Mar
14
2 months ago
Activity icon

Replied to Shopping Cart Singleton

PHP has no actual concept of an application. A singleton only lasts for the duration of a single request.

You'll need to use a session and use it to populate the cart with each request.

Mar
10
2 months ago
Activity icon

Replied to Make A Relation On DB

No, you can create and manage the database in whichever way you choose.

Activity icon

Replied to Make A Relation On DB

Use migrations and the many types of relationships in eloquent.

Mar
06
2 months ago
Activity icon

Replied to One Guard, Multiple User Types

It's just a discussion topic not a call for help.

I'm just interested in how other people might approach the problem.

Activity icon

Replied to One Guard, Multiple User Types

Yeah , the polymorphic type is that. But I forgot to add that the user types are very different with very different sets of attributes and relationships of their own.

Activity icon

Started a new Conversation One Guard, Multiple User Types

I'm interested to hear other ideas of now to achieve this.

I have a solution that involves a base user model (with the needed fields to authentcate) containing a one-to-one polymorphic relationship to multiple other models (user types).

I then have some custom middleware to check the polymorphic type of a logged in user and custom blade directives to do the same.

How would YOU approach something like this?

Mar
02
2 months ago
Activity icon

Replied to Click With Vanilla Javascript On This Code

What have you tried so far?

Feb
28
2 months ago
Activity icon

Awarded Best Reply on Vue Is Not A Constructor

The Vue 3 way to define a VM is ...

Vue.createApp(...)
Activity icon

Replied to Vue Is Not A Constructor

The Vue 3 way to define a VM is ...

Vue.createApp(...)
Feb
20
2 months ago
Activity icon

Replied to Folder Structure

Add a path in config/view.

Activity icon

Awarded Best Reply on Folder Structure

The layouts still need to be in the views folder.

Activity icon

Replied to Folder Structure

The layouts still need to be in the views folder.

Feb
17
2 months ago
Activity icon

Replied to No More TurboLinks. What's The SPA Solution Now?

Turbolinks hasn't suddenly become useless overnight because it's no longer in development.

Feb
14
3 months ago
Activity icon

Replied to How To Make A Service Class And And Call It In The Controller

Create the class, inject into the controller and away you go.

Feb
12
3 months ago
Activity icon

Replied to Discount Promo For Valentines Day?

Why would there be?

Feb
05
3 months ago
Activity icon

Replied to Illuminate Vs Laravel

Yes, you've thought about it or yes, you've done it?

Activity icon

Replied to Illuminate Vs Laravel

I'm not all that sure either, it's just something I'm throwing in the air!

But suppose somebody wanted to completely separate the domain, service, infrastructure and presentation layers? It might be the way to go. Gluing everything together again in a way that's appropriate for an app in a much more specific way.

Activity icon

Started a new Conversation Illuminate Vs Laravel

Here's an interesting question ...

Has anyone here developed (or thought about developing) an app using Illuminate components in a stand-alone way rather than wrapped in a Laravel app?

Jan
31
3 months ago
Activity icon

Started a new Conversation Acronyms In Namespace/Class Names

There doesn't seem to be (or I can't find) any PSR guidance on the use of acronyms in class names.

In the wider programming world, the idiomatic way of naming is mixed. Go thinks you should use all capitals but C# says only capitalise the first letter.

So, just out of interest, what do you all think?

class LoginDTO or class LoginDto

Jan
29
3 months ago
Activity icon

Replied to Laracast Who Admin Or Moderator ?

POST is Regret

Activity icon

Replied to VUE Is Regret.

READ is regret

Jan
19
3 months ago
Activity icon

Replied to Stack And Push What For?

It's so you can push different stuff from different places to the same place in a layout you might be extending.

If you just use section and yield, it will only yield one section.

Activity icon

Replied to Two User Tables?

Create a new guard and use it when logging in as a member/client.

Jan
13
4 months ago
Activity icon

Replied to How Can I Throw The Error From Axios (in Vuex Actions State) And Catch It In The Compoent ???

Not 100% sure but a try/catch block in the component should work.

Activity icon

Replied to Call Controller Functionality In Other Controller

Create another class, put the shared logic in there and inject into the controller(s).

Activity icon

Replied to Can I Create Separate User And Admin Login In Laravel ?

Create a base user table with the login details and a polymorphic relationship to however many user type tables you need.

Jan
07
4 months ago
Activity icon

Replied to How To Pass Id For Update In Laravel

Pass an array as the second argument to the route function.

Activity icon

Replied to How To Call Two Functions By One Route

You'll need to have a get and a post route.

https://laravel.com/docs/8.x/routing

Activity icon

Replied to How To Call Two Functions By One Route

Just call them in the controller.

Activity icon

Replied to Can't See Message Sent From Controller Laravel

You're not putting in the session, just passing it as a property to the view.

Dec
18
4 months ago
Dec
16
5 months ago
Activity icon

Replied to Boot Methode In Service Provider

Register happens when you register the provider and boot happens once all providers have been registered.

Dec
12
5 months ago
Activity icon

Started a new Conversation Up-to-date List Of Blade Directives?

Does anyone know of an up-to-date list of built in Blade directives?

I find it a little bit odd that there doesn't seem to be one in the Blade docs.

Thanks, peeps

Dec
11
5 months ago
Activity icon

Replied to Php 2021 Opinions

You'll hear in many places how absolutely everything is dead and buried.