I'm using Laravel 5.2 and Caffeinated Modules and when I try to go somewhere I get this error.
FatalErrorException in RouteServiceProvider.php line 42:
Modules\Users\Providers\RouteServiceProvider::Modules\Users\Providers{closure}(): Failed opening required 'Modules/Users/Http/routes.php' (include_path='.;C:\php\pear')
This is my routes.php in my Users module
Route::group(['middleware' => 'web'], function()
{
Route::get('admin/', [
'uses' => 'UsersController#admin',
'as' => 'login'
]);
});
I'm not sure what other code I need to give to solve this.
I had the same problem and I fixed it.
I just replace '\' in my path with '/'.
Related
I have just downloaded Laravel 5.7.2 project and found an issue below.
Below line does not work in Laravel 5.7.2 and gives 404
Route::get('/login',
array(
'uses' => 'Annonymous\Web\Auth\Login\LoginController#showLoginForm',
'as' => 'showLoginForm'
)
);
Below works in Laravel 5.7.2
Route::get('/', function () {
return view('Annonymous.welcome');
});
Below code works in Laravel 5.6.16 and 5.6.33
Route::get('/login',
array(
'uses' => 'Annonymous\Web\Auth\Login\LoginController#showLoginForm',
'as' => 'showLoginForm'
)
);
Any idea why the same code does not work in 5.7.2 ?
I can confirm that the route is present in the route list.
Since your project is not in root of Localhost
Try 'php artisan serve'
It Will Work
I'm getting MethodNotAllowedHttpException in RouteCollection.php line 218:
when i'm posting form within larave-localization route group.
Here is my localized route group:
Route::group([
'prefix' => LaravelLocalization::setLocale(),
'middleware' => [ 'localeSessionRedirect', 'localizationRedirect' ] ], function() {
Route::post('/offerselect', 'SearchController#getCarList');
Route::get('/', 'PageController#index');
});
I have a form inside index.blade php and it posts to /offerselect
but when i post it i get methodnotallowed exception. if i place the post outside of group it works without localization....
check
php artisan routes
to see if you're routes are defined correctly.
update: is that your whole routes.php?
I am currently trying to set up breadcrumbs for my Laravel 5 application. Unfortunately, I am currently being presented with this error when I access localhost:8888/auth/login:
ErrorException in
/Users/ben/Sites/laravel/vendor/davejamesmiller/laravel-breadcrumbs/src/CurrentRoute.php
line 29
The current route (GET /auth/login) is not named - please check
routes.php for an "as" parameter
Routes.php:
Route::get('auth/login', 'Auth\AuthController#getLogin',
['as' => 'login', 'uses' => 'Auth/AuthController#getLogin']);
The error is shown with or without the ['as' => 'login', 'uses' => 'Auth/AuthController#getLogin'] addition.
Breadcrumbs.php
Breadcrumbs::register('login', function($breadcrumbs)
{
$breadcrumbs->parent('home');
$breadcrumbs->push('Login', route('login'));
});
Thank you for your help.
I resolved this issue by changing the route to the following:
Route::get('auth/login',
['as' => 'login', 'uses' => 'Auth/AuthController#getLogin']);
You can only declare which controller method you're using once.
I have the following named route in routes.php:
Route::get('/', 'DefaultController#index', array('as' => 'home'));
Then, I try to get a link to the route in another view (404.blade.php), based on docs:
Go to homepage
However, the page with the code above thows this: Error in exception handler: Route [home] not defined. I tried using simply route('home') as well.
What am I missing?
The syntax for named routes is a bit different
Route::get('/', array('as' => 'home', 'uses' => 'DefaultController#index'));
This is my route
Route::get(
'account-executive/{$id}/edit',
array(
'as' => 'vendor-edit',
'uses' => 'AdminController#updateVendor'
)
);
This is my method
public function updateVendor($id)
{
$vendor = Vendor::findOrFail($id);
return View::make('admin.edit-account-executive');
}
I keep getting NotFoundHttpException. Any ideas as to why?
Your route definition isn't correct.
Route::get('account-executive/{$id}/edit', array('as' => 'vendor-edit','uses' => 'AdminController#updateVendor'));
You don't need a $ sign in definition of route parameter. So you should just write account-executive/{id}/edit.
Try it.