Support the ongoing development of Laravel.io →
Configuration Eloquent
Last updated 2 years ago.
0

I'm also upgrading to L5 from 4.2 and have 30+ classes. I'm creating a command that talks to all of them, so I'm forced to have 37 use \App\Models\[name].php statements at the top of my Command class. Gross!

Obviously I understand the value in proper Namespacing, but this is serious code bloat for me. In 4.2, I could access all my models with use App\Models;. Now, unless I'm mistaken, I can't do that?

Most of my use cases won't require that many, but even 10-15 isn't great. I assume the caveat of the old 4.2 method is that everything is imported into a single namespace, which is good for having less code, but bad for performance / considered quite dirty.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

joy014 joy014 Joined 12 Apr 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.