Support the ongoing development of Laravel.io →
Configuration Packages Architecture

Hi,

Currently I'm working on the back-end system of my website and I've created a module where admins can insert/update data. I use different classes so the top of my file looks like:

namespace App\Http\Controllers;
use App\User;
use Input;
use Validator;
use View;
use Redirect;

class myAwesomeClassThatDoesStuff extends Controller {
    // Stuff
}

It works fine but lots (practically all) my Controllers will have to 'use' these other classes. Is this the way because it seems kind of repetitive to me..

Last updated 3 years ago.
0
Solution

sven22, this is normal and not something you should really have to worry about. I use PHPStorm and let it add the use Class to the class I am working in.

One thing I noticed is your class name, first letter should be capitalized. Ignore if it was a typo :P

0

Thank you for your reply :-) The classname was a typo, but thanks for pointing it out!

0

Sign in to participate in this thread!

Eventy

Your banner here too?

sven22 sven22 Joined 8 Jan 2015

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.

© 2025 Laravel.io - All rights reserved.