It's probably just an issue with your namespace.
Check out this example to help you pinpoint the issue:
location: app/PurpleGriffin/ELearningCourses
namespace App\PurpleGriffin\ELearningCourses;
class ELearningCoursesClass {
public function convertPrice(){
//convert that price here yo
}
}
location: app/controllers
namespace App\Controllers;
use App\PurpleGriffin\ELearningCourses\ELearningCoursesClass;
class CoursesController {
public function getCourse()
{
$course = new ELearningCoursesClass();
}
}
Remember, you should call them from the root namespace. e.g:
$classVar = new class(); will become $classVar = new \class();
after all is said and done, you need to run your composer dump-autoload to get everything recognized.
Let me know if this helps.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community