October CMS Plugin Routes.php Not Registering
OctoberCMS Specific Problem,
When declaring routes in the {my}/{plugin}/Routes.php file they work on my local development environment which is a laravel Homestead Box. When I push it up to my production environment a Laravel-Forge provisioned (similar to homestead), it fails to register plugin routes.
There is the exact same code base on local & dev where I ran artisan route:list.
(LOCAL)[email protected]:~/default$ php artisan route:list
| Method | URI | Action |
|----------|---------------------|-----------------------------------------------------|
| GET|HEAD | chg/api/email/index | Chg\Email\Http\Controllers\[email protected] |
| POST | chg/api/email/send | Chg\Email\Http\Controllers\[email protected] |
| GET|HEAD | index_eli | Closure |
(REMOTE)[email protected]:~/default$ php artisan route:list
| Method | URI | | Action |
|----------|-------------|------|---------|
| GET|HEAD | sitemap.xml | | Closure |
Here are my plugins Routes.php file
<?php
Route::group(['prefix' => 'chg/api/email/'], function() {
Route::get('index', 'Chg\Email\Http\Controllers\[email protected]');
Route::post('send', 'Chg\Email\Http\Controllers\[email protected]');
});
Route::get('index_eli', function (){
return 'hello';
});
I want to point out that if I were to register a route under modules/cms/routes.php it works both locally and remotely.
besides the generic 404 page not found error I am not getting any errors. So my question is has anyone seen this before? and do they know where to look to diagnose this?
Answer
Problem is mention in your first line {my}/{plugin}/Routes.php
, R is capital it must be lower case for Linux system.
Its case sensitive issue, please change Routes.php
to routes.php
and it will work.
Linux treat Routes.php and routes.php as separate files and octoberCMS/Laravel look for routes.php not Routes.php
Related Questions
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS create a multi select Form field
- → October CMS - Conditionally Load a Different Page
- → How to disable assets combining on development in OctoberCMS
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → OctoberCms component: How to display all ID(items) instead of sorting only one ID?
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?