Our Black Friday sale is now live! All individual subscriptions are 50% OFF. This week only!

topvillas

topvillas

Member Since 5 Years Ago

Sandwich

Experience Points
215,365
Total
Experience

4,635 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
558
Lessons
Completed
Best Reply Awards
240
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 44
215,365 XP
Nov
19
5 days ago
Activity icon

Replied to Lighthouse MongoDB Laravel (call To Undefined Relationship)

The relationship is called 'managements'.

Nov
11
1 week ago
Activity icon

Replied to Service Layer

Service classes can easily become yet another god object to dump everything in.

Consider using job classes that have a very specific responsibility and are easy to unit test.

Activity icon

Replied to Better Way Of Routing In Laravel 8 Without All The Use Statements?

You could put the full namespace path instead of using use.

Either way, you'll have to put the namespace somewhere.

I'd stop worrying about it. Use code folding in your IDE to hide all the imports, if it really bothers you.

Nov
09
2 weeks ago
Activity icon

Replied to LiveWire Routes And SubDirectories

Use the namespace.

Nov
08
2 weeks ago
Activity icon

Replied to Getting 401 For No Apparent Reason!

It's for generating and returning a JWT token.

Activity icon

Replied to Getting 401 For No Apparent Reason!

I was just trying to test the route's existence.

But now I feel like a complete fool, of course the whole point of the route is to login using valid credentials.

Thanks, @tykus

Activity icon

Started a new Conversation Getting 401 For No Apparent Reason!

Hello peeps.

Please help me out here. I had a fresh installation of L8 with no changes to middleware or authetication and I'm using Pest for testing. For some reason, I'm getting a 401 with this very simple test. The route works perfectly well with Postman but for some reason in the test it goes wrong.

it('has a login endpoint', function () {
    $response = $this->post('api/login');

    $response->assertOk();
});

Any idea why?

Nov
06
2 weeks ago
Activity icon

Awarded Best Reply on Vue With Livewire

Caleb has some great screencasts for sponsors including one about how to use Pikkaday with Livewire and Apline.

It should also give you some great pointers about how to integrate other 3rd party JS libraries.

Activity icon

Replied to How Can I Decrease My Website Loading Time?

Are you minifying them?

How big are they?

What sort of connection are you testing them on?

Activity icon

Replied to Vue With Livewire

Caleb has some great screencasts for sponsors including one about how to use Pikkaday with Livewire and Apline.

It should also give you some great pointers about how to integrate other 3rd party JS libraries.

Nov
04
2 weeks ago
Activity icon

Replied to Javascript : Better To Use Const Or Let In Promises?

I'm not 100% sure on this but all those axios calls will return their own promises so you should be able to chain on a then to assign the results to wherever you like.

Activity icon

Awarded Best Reply on Javascript : Better To Use Const Or Let In Promises?

I'd use const for all your declarations in this case. Nothing is ever going to change.

Personally, I'd put those urls inline in the axios calls too.

Activity icon

Replied to Javascript : Better To Use Const Or Let In Promises?

I'd use const for all your declarations in this case. Nothing is ever going to change.

Personally, I'd put those urls inline in the axios calls too.

Nov
01
3 weeks ago
Activity icon

Replied to Laravel Code Generator Solution

Okay, well create prescription and an items tables. Store the patient's (and maybe the doctor's) id and the generated code in the prescription table and items belonging to the prescription in the items table then create the relationships between patients (and possible the doctor), prescription and items.

There's plenty of packages for creating PDFs from Blade templates that will help with that part.

By the way, I have no idea what kind of rules and regulations there are where you're from but in the UK, they'll be VERY tight regulations about storing medical data. You might want to look into that.

Activity icon

Replied to Laravel Code Generator Solution

What ideas have you had about how to do this so far?

Activity icon

Replied to Mixed Thoughts On Using Vue.js In Laravel

Use an animation when the state changes to make things smoother.

Oct
30
3 weeks ago
Activity icon

Replied to Is There Better Alternative To Laravel

You can still use laravel/ui. Just install it and off you go.

Oct
25
4 weeks ago
Activity icon

Replied to Livewire And Javascript

Use wire:ignore on whichever element contains the editor.

Activity icon

Replied to Livewire And Javascript

What @sinnbeck said.

I'd also say, you can show Caleb some love and sponsor him on Github. He has a load of excellent screencasts for sponsors with some pretty advanced lessons on using Livewire.

Activity icon

Replied to Livewire And Javascript

Livewire has a client object that can manage all sorts of stuff. Take a look under the apline section in the docs.

Oct
22
1 month ago
Activity icon

Replied to Regarding Laravel Livewire

Yep. Take a look at the upgrade guide from v1 to v2 in the docs. You can points routes at livewire components instead on controllers.

Oct
16
1 month ago
Activity icon

Replied to Rest Api - How Should I Proceed

OH, well there you go! I have zero experience with mobile apps.

Activity icon

Replied to Reduce The Impact Of Third-party Code

It tells you how.

Activity icon

Replied to Rest Api - How Should I Proceed

If you're making a mobile app then Sanctum isn't really an option (I should have mentioned that). It's only really of use if the api and site are on the same top level domain.

JWT looks like your best option.

Oct
15
1 month ago
Activity icon

Replied to Rest Api - How Should I Proceed

For authentication you have a few options.

Passport, Socialite, Sanctum or JWT. They all fill slightly different niches and you'll need to decide which would suit your needs best.

TYmon JWT package sits very nicely alongside Laravel's auth system.

Oct
14
1 month ago
Activity icon

Replied to Rest Api - How Should I Proceed

If you're building an API then yeah, put all your routes in the API section.

Have you thought about whether you need to secure the API?

Oct
08
1 month ago
Activity icon

Replied to SPA Application In Laravel 8

In v2 you can point Route::get at a Livewire component rather than a controller.

Take a look at upgrading from v1 to v2 in the docs.

Also consider using Turbolinks for an even more SPA feeling.

Sep
30
1 month ago
Activity icon

Replied to Star Rating

How long have you doing this?

Look at the API for the plugin, find out how to capture a change in the rating then put it in a hidden field.

Sep
26
1 month ago
Activity icon

Replied to Livewire Component (Updating String Data)

You could try, calling each step in turn and getting the function to dispatchBrowserEvent when it's done. Listen for the event on the client and then call the next step.

There's very probably a more elegant way to do it, but that should get you thinking along the right lines.

Livewire doesn't send anything back to the client when it's changed in a function, only when the function has executed fully.

Sep
20
2 months ago
Activity icon

Replied to Project Suggestion

An online shop is pretty much the ultimate project to muck about with.

Sep
09
2 months ago
Activity icon

Replied to Undefined Variable: Image

You're declaring $image inside the if statement.

Sep
04
2 months ago
Activity icon

Awarded Best Reply on Change Styling To Tailwind For Javascript Packages

Just a quick thought. You create a css with the class names that the plugins use and take advantage of Tailwind's @apply directive.

Activity icon

Replied to Best Way To Authorize Applications In Laravel Gateway ( Not Users )

Google use API tokens. I'm not sure what sort of better solution you're looking for.

Activity icon

Replied to Change Styling To Tailwind For Javascript Packages

Just a quick thought. You create a css with the class names that the plugins use and take advantage of Tailwind's @apply directive.

Activity icon

Replied to Best Way To Authorize Applications In Laravel Gateway ( Not Users )

There;'s nothing wrong with a token.

If you want to secure things a bit further then you could check the token against the referer.

Activity icon

Replied to Overwhelmed With Templating And Front-end Frameworks. Help Me Out

If you're very comfortable with Blade then have a serious look at Livewire with Alpine. There's a lot less switching of mindsets from PHP to JS while developing your app.

But as @tray2 said, it very much depends of the type of app you're creating.

Aug
21
3 months ago
Activity icon

Replied to Is Blade Component Basically Livewire?

No, Livewire enables you to communicate between the server and client in ways that will blow your mind, Blade components are purely server rendered HTML.

Aug
05
3 months ago
Activity icon

Replied to What Do You Think About This Approach? ("Internal" Api Requests Returning HTML)

That's the kiddie! Might be useful if Livewire is a bit more than you need.

Activity icon

Replied to What Do You Think About This Approach? ("Internal" Api Requests Returning HTML)

There is another open source library that github use themselves but I can't remember it's name or whether it's just for Rails.

Activity icon

Replied to What Do You Think About This Approach? ("Internal" Api Requests Returning HTML)

It's a perfectly viable approach and one that Github use.

Check out Livewire.

https://laravel-livewire.com/

Jul
31
3 months ago
Activity icon

Replied to Refactor Repetitive Code Inside A Trait

You could create a static method on the Project model?

Jul
30
3 months ago
Activity icon

Replied to How To Get Vue Router To Go To Another Page

Do you get any errors in dev tools?

Jul
23
4 months ago
Activity icon

Replied to Disable Field

Are you using a framework or vanilla Javascript?

Jul
22
4 months ago
Activity icon

Replied to How Access From Blade File To Function From Repository?

Eager load the relationship when you fetch the cards.

A blade file really isn't the place to be be making database calls.

Activity icon

Replied to How Access From Blade File To Function From Repository?

Don't. Make the query in the controller and pass the data to the template.

Jul
20
4 months ago
Activity icon

Replied to Model Test Coverage

Thanks for the responses, peeps.

Very helpful.

Activity icon

Replied to Model Test Coverage

Thanks, Tykus. I did hear somewhere that there comes a point when the time spent writing tests outweighs their usefulness.