Laravel Action Route not Define

I have unique problem. I already create Route on web.php, on Controller, and Blade. and working on my localhost. but after publish to real server, I jus got error Action url\controller@function not define. this is my code.

Route::get('/timetableschedule', 'ManagementController@EmployeeTimeTable');

this is my web.php

public function EmployeeTimeTable(Request $request){
    $session = $request->session()->get('');
    $companysession = $request->session()->get('user.location');
    $locationdata = DB::table('company')

    $userlist = db::table('users')

    $timesetting = db::table('time_leaving')

    $leaveschedule = db::table('employee_leaving')

    return view('Management.employeetimetable',['location'=>$locationdata,'UserList'=>$userlist,'ListTimeSet'=>$timesetting,'LeavingSchedule'=>$leaveschedule]);

this is my controller

          <a href="{{action('ManagementController@EmployeeTimeTable')}}" class="dropdown-item">
            <p>Employee Timetable</p>

and this is code on blade to call controller@function

this step same as another controller, web, and blade.php. but, just for this rout get me a trouble. thank you

>Solution :

If your controller is on a subfolder, and not in app\Http\Controllers you will need to provide the fully qualified class name of the controller to the action helper :


by default action helper will look for : App\Http\Controllers\ManagementController

note that this syntax will not work as you might expect :


because laravel will not add App\Http\Controllers if there is a \ in the action name parameter

Leave a Reply