Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

louiss0's avatar

louiss0 wrote a comment+100 XP

5mos ago

Practical TypeScript for the Laravel Developer: Ep 14, Generating Types with Laravel Wayfinder

You should find a way not to use namespace. As an industry we are moving away from TS only features.

louiss0's avatar

louiss0 liked a comment+100 XP

5mos ago

Does it make sense to separate data fetching logic from a controller to somewhere else?

There are many ways to go about this.

  1. Keep it in the controller
  2. Move the fetch to the model
  3. Create a service class that you and move the fetch there
  4. Use some fancy pattern to achieve the result

Which ever you choose, don't make it more complex than you need to. The logic is quite easy to refactor if and when you need to.

Be aware that your API (When you move there) probably should use a JSON Resource

https://laravel.com/docs/12.x/eloquent-resources

louiss0's avatar

louiss0 wrote a comment+100 XP

5mos ago

Build a Forum With Laravel: Ep 41, Upgrading Vue

@lukedowning19 Did you ever find a new solution to this?