skip to Main Content

Error with mapping out routes to controller classes in Laravel

I am having an issue when trying to define my routes to controller classes in Laravel. My web.php route looks like this: use AppHttpControllersFrontendArticlesController as FrontEndArticlesController; Route::get('/articles/{article:slug}', [FrontendArticlesController::class, 'show']); The controller looks like this: namespace AppHttpControllers; use AppModelsArticle; use IlluminateHttpRequest;…

VIEW QUESTION

In Laravel controller file, I would like to change the date format of regDate from 'Y-m-d' to 'd/m/Y'. RegDate from table is in YYYY-mm-dd

I would like to format "regDate" to 'dd/mm/YYYY' from 'YYYY/mm/dd'. Appreciate any help. Thanks. if ($request->keyword != "") { $students = Student::where ("name","LIKE","%" . $request->keyword . "%") ->orWhere("nric","LIKE","%" . $request->keyword . "%") ->orWhere("address","LIKE","%" . $request->keyword . "%") ->orWhere("telNo","LIKE","%" . $request->keyword…

VIEW QUESTION

laravel Target class [TestController] does not exist

I use Laravel Framework 9.31.0 on win11 I used action syntax in the file routesweb.php: Route::get('role', [TestController::class, 'index']); or full path to controller: => 'appHttpControllersTestController@index' or like this: use appHttpControllersTestController; Also I declared variable $namespace in the file appProvidersRouteServiceProvider.php and…

VIEW QUESTION
Back To Top
Search