title: Controller action is not available
body: <p>I am not familiar with laravel but from what I red I made this:
  My controller:</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  
  use Illuminate\Http\Request;
  
  class ChatController extends Controller
  {
      public function index(Request $request)
      {
          var_dump(123123);die;
          if (!Auth::check()) {
              return redirect('/');
          }
  
          return 1;
      }
  }
  </code></pre>
  
  <p>Now I am trying to request it like <code>domain.com/open-chat</code>. And my <code>web.php</code> configuration about it is:</p>
  
  <pre><code>Route::get('/open-chat', 'ChatController@index');
  </code></pre>
  
  <p>But I am getting redirected to the home page. I`ve checked the middleware controllers if some of it redirects me but no. The other controllers ( which were already made when I came ) works fine. What am I missing ?</p>
  
  <p><strong>EDIT</strong>
  web.php</p>
  
  <pre><code>&lt;?php
  
  /*
  |--------------------------------------------------------------------------
  | Web Routes
  |--------------------------------------------------------------------------
  |
  | Here is where you can register web routes for your application. These
  | routes are loaded by the RouteServiceProvider within a group which
  | contains the "web" middleware group. Now create something great!
  |
  */
  
  Route::get('/clear-cache', function() {
      Artisan::call('cache:clear');
      return "Cache is cleared";
  });
  Route::get('/config-cache', function() {
      Artisan::call('config:cache');
      return "Config is cleared";
  });
  
  Route::get('/view', function() {
      Artisan::call('view:clear');
      return "View is cleared";
  });
  
  /* Route::get('/', function () {
      return view('welcome');
  }); */
  
  Route::group(['prefix' =&gt; 'siteadmin', 'namespace' =&gt; 'Admin'], function () {
  
      Route::get('/', 'Auth\LoginController@showLoginForm');
      Route::post('login', 'Auth\LoginController@login')-&gt;name('admin.login');
      Route::post('logout', 'Auth\LoginController@logout')-&gt;name('admin.logout');
  });
  
  Route::group(['prefix'=&gt;'siteadmin', 'namespace' =&gt; 'Admin','middleware' =&gt; 'auth'], function () {  
      Route::get('/dashboard', 'DashboardController@index')-&gt;name('dashboard.index');
      Route::get('/edit-profile', 'CommonController@editProfile');
      Route::post('/updateprofile', 'CommonController@updateprofile');
  
      /**
          Routes for site settings
      **/
      Route::get('/site-settings', 'SiteSettingController@index')-&gt;name('sitesettings.index');
      Route::post('/site-settings/store', 'SiteSettingController@store')-&gt;name('sitesettings.save');
  
  
      Route::get('/subject-categories', 'SubjectCategoriesController@index')-&gt;name('subject-categories.index');
      Route::get('/subject-categories/create', 'SubjectCategoriesController@create')-&gt;name('subject-categories.create');
      Route::post('/subject-categories/store', 'SubjectCategoriesController@store')-&gt;name('subject-categories.store');
      Route::get('/subject-categories/edit/{id}', 'SubjectCategoriesController@edit')-&gt;name('subject-categories.edit');
      Route::post('/subject-categories/update/{id}', 'SubjectCategoriesController@update')-&gt;name('subject-categories.update');
      Route::get('/subject-categories/drop/{id}', 'SubjectCategoriesController@drop')-&gt;name('subject-categories.drop');
      Route::post('/subject-categories/delete-image/{id}', 'SubjectCategoriesController@deleteImage');
  
  
      /**
          Routes for teachers users
      **/
      Route::get('/users/teachers', ['middleware'=&gt;'auth','uses'=&gt;'UserController@getTeachersList'])-&gt;name('teachers.index');
      Route::get('/users/teachers/create', ['middleware'=&gt;'auth','uses'=&gt;'UserController@createTeacher'])-&gt;name('teachers.create');
      Route::post('/users/teachers/save', ['middleware'=&gt;'auth','uses'=&gt;'UserController@saveTeacher'])-&gt;name('teachers.save');
      Route::get('/users/teachers/edit/{id}', ['middleware'=&gt;'auth','uses'=&gt;'UserController@editTeacher'])-&gt;name('teachers.edit');
      Route::get('/users/teachers/show/{id}', ['middleware'=&gt;'auth','uses'=&gt;'UserController@showTeacher'])-&gt;name('teachers.show');
      Route::post('/users/teachers/update/{id}', ['middleware'=&gt;'auth','uses'=&gt;'UserController@updateTeacher'])-&gt;name('teachers.update');
      Route::get('/users/teachers/delete/{id}', ['middleware'=&gt;'auth','uses'=&gt;'UserController@deleteTeacher']);
      Route::get('/users/teachers/change-status/{id}', ['middleware'=&gt;'auth','uses'=&gt;'UserController@changeTeacherStatus']);
      Route::post('/users/get-cities-by-country', ['middleware'=&gt;'auth','uses'=&gt;'UserController@getCitiesByCountry']);
      Route::get('/users/teachers/messages/{id}', ['middleware'=&gt;'auth','uses'=&gt;'UserController@getTeacherMessageThreads'])-&gt;name('teachers.messages');
      Route::get('/users/teachers/view-message/{id}', ['middleware'=&gt;'auth','uses'=&gt;'UserController@getAllMessagesByThreadID'])-&gt;name('teacher.view-message');
      Route::post('/users/teachers/delete-profile-image/{id}', ['middleware'=&gt;'auth','uses'=&gt;'UserController@deleteTeacherProfileImage']);
  
      /**
          Routes for driver users
      **/
      Route::get('/users/students', ['middleware'=&gt;'auth','uses'=&gt;'UserController@getStudentsList'])-&gt;name('students.index');
      Route::get('/users/students/create', ['middleware'=&gt;'auth','uses'=&gt;'UserController@createStudent'])-&gt;name('students.create');
      Route::post('/users/students/save', ['middleware'=&gt;'auth','uses'=&gt;'UserController@saveStudent'])-&gt;name('students.save');
      Route::get('/users/students/edit/{id}', ['middleware'=&gt;'auth','uses'=&gt;'UserController@editStudent'])-&gt;name('students.edit');
      Route::get('/users/students/show/{id}', ['middleware'=&gt;'auth','uses'=&gt;'UserController@showStudent'])-&gt;name('students.show');
      Route::post('/users/students/update/{id}', ['middleware'=&gt;'auth','uses'=&gt;'UserController@updateStudent'])-&gt;name('students.update');
      Route::get('/users/students/delete/{id}', ['middleware'=&gt;'auth','uses'=&gt;'UserController@deleteStudent']);
      Route::get('/users/students/change-status/{id}', ['middleware'=&gt;'auth','uses'=&gt;'UserController@changeStudentStatus']);
  
      /**
          Routes for countries
      **/
      Route::get('/countries', ['middleware'=&gt;'auth','uses'=&gt;'CountryController@index'])-&gt;name('countries.index');
      Route::get('/countries/create', ['middleware'=&gt;'auth','uses'=&gt;'CountryController@create'])-&gt;name('countries.create');
      Route::post('/countries/save', ['middleware'=&gt;'auth','uses'=&gt;'CountryController@store'])-&gt;name('countries.save');
      Route::get('/countries/edit/{id}', ['middleware'=&gt;'auth','uses'=&gt;'CountryController@edit'])-&gt;name('countries.edit');
      Route::get('/countries/show/{id}', ['middleware'=&gt;'auth','uses'=&gt;'CountryController@show'])-&gt;name('countries.show');
      Route::post('/countries/update/{id}', ['middleware'=&gt;'auth','uses'=&gt;'CountryController@update'])-&gt;name('countries.update');
      Route::get('/countries/delete/{id}', ['middleware'=&gt;'auth','uses'=&gt;'CountryController@destroy']);
      Route::get('/countries/change-status/{id}', ['middleware'=&gt;'auth','uses'=&gt;'CountryController@changeStatus']);
      Route::post('/countries/delete-image/{id}', ['middleware'=&gt;'auth','uses'=&gt;'CountryController@deleteImage']);
  
      /**
          Routes for cities
      **/
      Route::get('/cities', ['middleware'=&gt;'auth','uses'=&gt;'CityController@index'])-&gt;name('cities.index');
      Route::get('/cities/create', ['middleware'=&gt;'auth','uses'=&gt;'CityController@create'])-&gt;name('cities.create');
      Route::post('/cities/save', ['middleware'=&gt;'auth','uses'=&gt;'CityController@store'])-&gt;name('cities.save');
      Route::get('/cities/edit/{id}', ['middleware'=&gt;'auth','uses'=&gt;'CityController@edit'])-&gt;name('cities.edit');
      Route::get('/cities/show/{id}', ['middleware'=&gt;'auth','uses'=&gt;'CityController@show'])-&gt;name('cities.show');
      Route::post('/cities/update/{id}', ['middleware'=&gt;'auth','uses'=&gt;'CityController@update'])-&gt;name('cities.update');
      Route::get('/cities/delete/{id}', ['middleware'=&gt;'auth','uses'=&gt;'CityController@destroy']);
      Route::get('/cities/change-status/{id}', ['middleware'=&gt;'auth','uses'=&gt;'CityController@changeStatus']);
      Route::post('/cities/delete-image/{id}', ['middleware'=&gt;'auth','uses'=&gt;'CityController@deleteImage']);
  
      /**
          Routes for subjects
      **/
      Route::get('/subjects', ['middleware'=&gt;'auth','uses'=&gt;'SubjectController@index'])-&gt;name('subjects.index');
      Route::get('/subjects/create', ['middleware'=&gt;'auth','uses'=&gt;'SubjectController@create'])-&gt;name('subjects.create');
      Route::post('/subjects/save', ['middleware'=&gt;'auth','uses'=&gt;'SubjectController@store'])-&gt;name('subjects.save');
      Route::get('/subjects/edit/{id}', ['middleware'=&gt;'auth','uses'=&gt;'SubjectController@edit'])-&gt;name('subjects.edit');
      Route::get('/subjects/show/{id}', ['middleware'=&gt;'auth','uses'=&gt;'SubjectController@show'])-&gt;name('subjects.show');
      Route::post('/subjects/update/{id}', ['middleware'=&gt;'auth','uses'=&gt;'SubjectController@update'])-&gt;name('subjects.update');
      Route::get('/subjects/delete/{id}', ['middleware'=&gt;'auth','uses'=&gt;'SubjectController@destroy']);
      Route::get('/subjects/change-status/{id}', ['middleware'=&gt;'auth','uses'=&gt;'SubjectController@changeStatus']);
  
      /**
          Routes for classes
      **/
      Route::get('/classes', ['middleware'=&gt;'auth','uses'=&gt;'ClassController@index'])-&gt;name('classes.index');
      Route::get('/classes/create', ['middleware'=&gt;'auth','uses'=&gt;'ClassController@create'])-&gt;name('classes.create');
      Route::post('/classes/save', ['middleware'=&gt;'auth','uses'=&gt;'ClassController@store'])-&gt;name('classes.save');
      Route::get('/classes/edit/{id}', ['middleware'=&gt;'auth','uses'=&gt;'ClassController@edit'])-&gt;name('classes.edit');
      Route::get('/classes/show/{id}', ['middleware'=&gt;'auth','uses'=&gt;'ClassController@show'])-&gt;name('classes.show');
      Route::post('/classes/update/{id}', ['middleware'=&gt;'auth','uses'=&gt;'ClassController@update'])-&gt;name('classes.update');
      Route::get('/classes/delete/{id}', ['middleware'=&gt;'auth','uses'=&gt;'ClassController@destroy']);
      Route::get('/classes/change-status/{id}', ['middleware'=&gt;'auth','uses'=&gt;'ClassController@changeStatus']);
      Route::post('/classes/get-subjects-by-category', ['middleware'=&gt;'auth','uses'=&gt;'ClassController@getSubjectsByCategory']);
  
      /**
          Routes for sliders
      **/
  
      Route::get('/sliders', 'SliderController@index')-&gt;name('sliders.index');
      Route::get('/sliders/create', 'SliderController@create')-&gt;name('sliders.create');
      Route::post('/sliders/store', 'SliderController@store')-&gt;name('sliders.save');
      Route::get('/sliders/edit/{id}', 'SliderController@edit')-&gt;name('sliders.edit');
      Route::post('/sliders/update/{id}', 'SliderController@update')-&gt;name('sliders.update');
      Route::get('/sliders/delete/{id}', 'SliderController@destroy')-&gt;name('sliders.delete');
      Route::get('/sliders/change-status/{id}', ['middleware'=&gt;'auth','uses'=&gt;'SliderController@changeStatus']);
      Route::post('/sliders/delete-image/{id}', 'SliderController@deleteImage');
  
  
      /**
          Routes for teacher classes
      **/
  
      Route::get('/teacher-classes', 'TeacherClassController@index')-&gt;name('teacher-classes.index');
      Route::get('/teacher-classes/create', 'TeacherClassController@create')-&gt;name('teacher-classes.create');
      Route::post('/teacher-classes/store', 'TeacherClassController@store')-&gt;name('teacher-classes.save');
      Route::get('/teacher-classes/edit/{id}', 'TeacherClassController@edit')-&gt;name('teacher-classes.edit');
      Route::post('/teacher-classes/update/{id}', 'TeacherClassController@update')-&gt;name('teacher-classes.update');
      Route::get('/teacher-classes/delete/{id}', 'TeacherClassController@destroy')-&gt;name('teacher-classes.delete');
      Route::post('/teacher-classes/get-subjects-by-category', 'TeacherClassController@getSubjectsByCategory');
      Route::post('/teacher-classes/get-classes-by-category-and-subject', 'TeacherClassController@getClassesBySubjectAndCategory');
  
      /**
          Routes for orders
      **/
  
      Route::get('/orders', 'OrderController@index')-&gt;name('orders.index');
      Route::get('/orders/show/{id}', 'OrderController@show')-&gt;name('orders.show');
      Route::get('/orders/export-orders', 'OrderController@exportOrders')-&gt;name('orders.export-orders');
  
      /**
          Routes for bookings
      **/
  
      Route::get('/bookings', 'BookingController@index')-&gt;name('bookings.index');
      Route::get('/bookings/teacher-bookings/{teacher_id}', 'BookingController@getTeacherAllBookings')-&gt;name('bookings.bookings');
      Route::get('/bookings/show/{id}', 'BookingController@show')-&gt;name('bookings.show');
      Route::get('/bookings/export-teacher-bookings/{teacher_id}', 'BookingController@exportTeacherBookings')-&gt;name('bookings.export-teacher-bookings');
  
      /**
          Routes for bookings
      **/
  
      Route::get('/messages', 'MessageController@index')-&gt;name('messages.index');
      Route::get('/messages/show/{id}', 'MessageController@show')-&gt;name('messages.show');
  
      /**
          Routes for reviews
      **/
  
      Route::get('/reviews', 'ReviewController@index')-&gt;name('reviews.index');
      Route::get('/reviews/show/{id}', 'ReviewController@show')-&gt;name('reviews.show');
  
  
      /**
          Routes for blogs
      **/
  
      Route::get('/blogs', 'BlogController@index')-&gt;name('blogs.index');
      Route::get('/blogs/create', 'BlogController@create')-&gt;name('blogs.create');
      Route::post('/blogs/store', 'BlogController@store')-&gt;name('blogs.save');
      Route::get('/blogs/edit/{id}', 'BlogController@edit')-&gt;name('blogs.edit');
      Route::post('/blogs/update/{id}', 'BlogController@update')-&gt;name('blogs.update');
      Route::get('/blogs/delete/{id}', 'BlogController@destroy')-&gt;name('blogs.delete');
      Route::get('/blogs/change-status/{id}', ['middleware'=&gt;'auth','uses'=&gt;'BlogController@changeStatus']);
      Route::post('/blogs/delete-image/{id}', 'BlogController@deleteImage');
  
  });
  
  Auth::routes();
  
  Route::get('{locale?}', 'HomeController@index');
  Route::get('/en', 'HomeController@index');
  Route::get('/open-chat', 'ChatController@index');
  Route::get('/ar', 'HomeController@index');
  Route::get('/home', 'HomeController@index')-&gt;name('home');
  
  Route::post('/get-cities-by-country', 'SearchController@getCitiesByCountry');
  Route::post('/get-subjects-by-category', 'SearchController@getSubjectsByCategory');
  
  Route::post('/register', 'CommonController@register');
  Route::post('/login', 'CommonController@login');
  Route::post('/forgot-password', 'CommonController@forgotPassword');
  Route::get('/{locale?}/reset-password/{token}', 'CommonController@resetPassword');
  Route::post('/{locale?}/resetpassword', 'CommonController@resetNewPassword')-&gt;name('reset-pass');
  
  Route::get('/{locale?}/classes/search', 'ClassController@searchClasses')-&gt;name('search');
  Route::get('/{locale?}/classes/all-cities', 'ClassController@getAllCitiesClasses');
  Route::get('/{locale?}/classes/{type}/{id}', 'ClassController@getClassesByType');
  
  Route::get('/{locale?}/view-class/{id}', 'ClassController@viewTeacherClassDetails')-&gt;name('view-class');
  Route::get('/{locale?}/finish-class/{id}', 'ClassController@finishTeacherClass')-&gt;name('finish-class');
  
  Route::post('/create-booking', 'CommonController@createBooking');
  Route::post('/{locale?}/submit-review', 'CommonController@submitReview');
  
  Route::get('/{locale?}/blogs', 'HomeController@getAllBlogs')-&gt;name('blogs');
  Route::get('/{locale?}/blogs/{slug}', 'HomeController@getBlogDetails')-&gt;name('blogs.detail');
  
  
  Route::get('/paypal/checkout/{order}/completed', [
      'name' =&gt; 'PayPal Express Checkout',
      'as' =&gt; 'paypal.checkout.completed',
      'uses' =&gt; 'User\BookingController@completed',
  ]);
  
  Route::get('/paypal/checkout/{order}/cancelled', [
      'name' =&gt; 'PayPal Express Checkout',
      'as' =&gt; 'paypal.checkout.cancelled',
      'uses' =&gt; 'User\BookingController@cancelled',
  ]);
  
  Route::post('/webhook/paypal/{order?}/{env?}', [
      'name' =&gt; 'PayPal Express IPN',
      'as' =&gt; 'webhook.paypal.ipn',
      'uses' =&gt; 'User\BookingController@webhook',
  ]);
  
  /**
      User dashboard routes start
  **/
  Route::group(['prefix'=&gt;'{locale?}/user', 'namespace' =&gt; 'User','middleware' =&gt; 'auth'], function () {
      Route::get('/dashboard', 'DashboardController@index')-&gt;name('user.dashboard');
      Route::get('/edit-profile', ['uses'=&gt;'ProfileController@editProfile'])-&gt;name('user.edit-profile');
      Route::post('/update-profile/{id}', ['uses'=&gt;'ProfileController@updateProfile'])-&gt;name('user.update-profile');
      Route::post('/update-image/{id}', ['uses'=&gt;'ProfileController@updateUserImage'])-&gt;name('user.update-image');
      Route::get('/change-password', ['uses'=&gt;'ProfileController@changePassword'])-&gt;name('user.change-password');
      Route::post('/update-password', ['uses'=&gt;'ProfileController@updatePassword'])-&gt;name('user.update-password');
  
      Route::get('/my-classes', ['uses'=&gt;'ClassController@getTeacherClasses'])-&gt;name('user.my-classes');
      Route::get('/my-classes/add-new-class', ['uses'=&gt;'ClassController@createNewClass'])-&gt;name('user.add-new-class');
      Route::post('/my-classes/save-class', ['uses'=&gt;'ClassController@saveClass'])-&gt;name('user.save-class');
      Route::get('/my-classes/edit-class/{id}', ['uses'=&gt;'ClassController@editClass'])-&gt;name('user.edit-class');
      Route::post('/my-classes/update-class/{id}', ['uses'=&gt;'ClassController@updateClass'])-&gt;name('user.update-class');
      Route::get('/my-classes/delete-class/{id}', ['uses'=&gt;'ClassController@deleteClass']);
  
  
      Route::post('/get-subjects-by-category', ['uses'=&gt;'ClassController@getSubjectsByCategory']);
      Route::post('/get-classes-by-category-and-subject', ['uses'=&gt;'ClassController@getClassesByCategoryAndSubject']);
  
      Route::get('/my-bookings', ['uses'=&gt;'BookingController@getAllBookings'])-&gt;name('user.my-bookings');
      Route::get('/my-bookings/view-booking-details/{id}', ['uses'=&gt;'BookingController@viewBookingDetails'])-&gt;name('user.view-booking-details');
      Route::get('/my-bookings/cancel-booking/{type}/{id}', ['uses'=&gt;'BookingController@cancelBooking']);
      Route::get('/my-bookings/accept-booking/{id}', ['uses'=&gt;'BookingController@acceptBooking']);
      Route::post('/make-a-payment', ['uses'=&gt;'BookingController@makePayment'])-&gt;name('user.make-payment');
  
      Route::get('/my-orders', ['uses'=&gt;'OrderController@getAllOrders'])-&gt;name('user.my-orders');
      Route::get('/messages', ['uses'=&gt;'MessageController@getMessageThreads'])-&gt;name('user.messages');
      Route::get('/messages/view-messages/{thread_id}', ['uses'=&gt;'MessageController@getAllMessagesByThreadID'])-&gt;name('user.view-messages');
      Route::post('/messages/send-message', ['uses'=&gt;'MessageController@sendMessage']);
  
      Route::get('/reviews', ['uses'=&gt;'BookingController@getAllReviews'])-&gt;name('user.reviews');
  
  });
  </code></pre>
  
  <p>Extended <code>Controller.php</code>:</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  
      use Illuminate\Foundation\Bus\DispatchesJobs;
      use Illuminate\Routing\Controller as BaseController;
      use Illuminate\Foundation\Validation\ValidatesRequests;
      use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
  
      class Controller extends BaseController
      {
          use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
      }
  </code></pre>