Class not found
-
Don' need to add src, second one is right.
-
Dear @rahul
thats what i did still showing me class not found ?
namespace Drov\Address\Http\Controllers; use Illuminate\Http\Request; use packages\Drov\Address\Models\Area;
<?php namespace packages\Drov\Address\Models; use Illuminate\Database\Eloquent\Model; class Area extends Model { // }
is there another solution ?
i did create the model manually not using php artisan does that cause not to work ?
only the migration file i did it with php artisan
Please advise ?
Best regards
-
You have used wrong namespace.
Did your model is present like (Directory structure) -
Packages->Drov->Address->Models->Area.
Is that directory structure for your model.
Thanks
-
Dear @rahul
yes that is correct , the error shows the
<?php namespace Drov\Address\Http\Controllers; use Illuminate\Http\Request; use packages\Drov\Address\Models\Area; // when you want to use the model you put the whole path correct ?
the error is from the AreaController where it cant see the model
the full path to Area.php model
packages/Drov/Address/src/Models
best regards
-
i have to insert Area in order to use it
$area = new Area();
-
-
/Area
where do you mean ?
use packages\Drov\Address\Models\Area; // like this use packages/Drov/Address/Models/Area; // it does not. work error
-
-
-
Hello @cmpengineers
Push your code on git hub or git lab, and add me.
I need to check. -
Dear @rahul
finally its working i only needed to add App\
use App\packages\Drov\src\Models\Area;
Best regards
-
Dear @rahul
use App\packages\Drov\src\Models\Area; // this is the one that is working
i really appreciate it your effort
Best regards
-
This post is deleted!