Reputation: 340
I started a laravel project in version 5.5, I have been working with version 5.1.
In this version I use the folder 'nob' and I use it to develop some classes to turn them into components.
I used the following composer.json in the version 5.1:
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/",
"Nob\\": "nob/"
}
},
And this is the version 5.5:
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"App\\": "app/",
"Nob\\": "nob/"
}
},
This is the class, her namespace is correct
<?php namespace Nob\Payeezy\Types;
use Nob\Payeezy\Payeezy;
class Authorization extends Payeezy
{
And this is the tree:
I use PhpStorm and he recognizes the namespace
I do not know what may be happening, I used composer dump-autoload and nothing.
Upvotes: 2
Views: 40439
Reputation: 372
Your code is correct when I tried on my PhpStorm. But you can run the following three commands:
$ php artisan clear-compiled
$ composer dump-autoload
$ php artisan optimize
And this will clear the current compiled files, update the classes it needs and then write them back out so you don't have to do it again.
Upvotes: 6
Reputation: 1412
You can use this commands may can help you:
composer dump-autoload -o
Good Luck
Upvotes: 0