Support the ongoing development of Laravel.io →
posted 11 years ago
IOC

Hey everyone,

I have created a custom folder (for custom classes etc) my autoload class map looks like this

"autoload": {
		"classmap": [
            "app/commands",
            "app/controllers",
            "app/models",
            "app/database/migrations",
            "app/tests/TestCase.php",
            "app/Custom"
        ]
	},

I am trying to access Custom\Select\Select() My file structure looks like this Custom Select Select.php interfaces

and in Select.php I have

<?php

namespace Custom\Select;

class Select implements Custom\Select\interfaces\Select {

I have run composer dump -o to reload the autoloader but I am getting Class 'Custom\Select\Select' not found when I try to run it.

Any ideas would be awesome (I am not used to composer - working with Laravel is the first case I have used it) Cheers Colin

Last updated 3 years ago.
0

If you're using namespace you are better of using the psr-4 autoloader.

"autoload": {
    "classmap": [
        "app/commands",
        "app/controllers",
        "app/models",
        "app/database/migrations",
        "app/tests/TestCase.php"
    ],
    "psr-4": {
    		"Custom\\": "app/Custom"
    }
},
Last updated 3 years ago.
0

Sweet thanks!

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Cmarenburg cmarenburg Joined 25 Feb 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.

© 2025 Laravel.io - All rights reserved.