Anyone help me to prevent this error on the server, localhost works fine.
I did not find the error even if I searched.
this is the error every time used the application, cookies problem
my code on routes
Route::auth();
Route::group(['middleware' => ['auth']], function () {
Route::get('/', 'DashboardController#index');
Route::get('/users','UsersController#index');
Route::get('/users/create','UsersController#create');
Route::post('/users/store','UsersController#store');
Route::get('/users/list_data','UsersController#list_data');});
Is the problem with the server? or my code?
Sorry for my bad English
Related
I've been laraveling for 5 months now but I reformatted ubuntu and installed Laravel, this time, it's Laravel 7 instead of Laravel 6. My problem is simple routing giving an error. It's so dead simple you might think I'm a stupid beginner.
In my Web.php
Route::get('/about', function () {
return view('welcome');
});
Route::get('/', function () {
return view('welcome');
});
I also tried using a controller that returns a view and just a simple "string" in Web.php
Route::get('/about', 'UserController#index');
Typing http://localhost/about in the address bar in chrome causes 404 error.
As you can see, there should be no problem returning the same view('welcome'), even if I return a simple return "TEST";, results are the same.
I tried downgrading to Laravel 6 by deleting vendor, changing the Laravel v6 in composer.json and running composer install but still the same, so I think it's not the version.
This has never happened to me before even when I first started with Laravel 6 five months ago and it's a totally fresh project.
enable rewrite_mode of Apache server and restart Apache server it will solve the issue.
Run server with php artisan serve
and then try http://localhost:8000/about hope it will fix your problem
OR
Simply use http://localhost/project/about
so I started to use Laravel auth and in my Route in web middleware I wrote :
Route::group(['middleware' => ['web']], function () {
Route::auth();
});
and I got this error :
Maximum function nesting level of '100' reached, aborting!
and I tried to use this instead :
Route::auth();
Route::group(['middleware' => ['web']], function () {...});
and then when I wanted to use old function in my form I got this error
Session store not set on request.
can you help me , a tutorial link is also a good idea :)
This is the problem of recursion. So,go into your php.ini configuration file and change the following line:
xdebug.max_nesting_level=100
to something like:
xdebug.max_nesting_level=200
Edit:
If you are using wamp then please comment
zend_extension = "d:/wamp/bin/php/php5.3.8/zend_ext/php_xdebug-2.1.2-5.3-vc9.dll //here wamp is installed in d drive.
in my php.ini file. This extension should be limiting the stack to 100 .
I fixed this problem by adding this line in bootstrap/autoload.php
ini_set('xdebug.max_nesting_level', 200);
I have a Laravel 5.2 application running ok in the live server. It was also running ok in a Ubuntu 14.04 with Apache server.
Now I am using a MAC so I made a fresh installation of my App using the MAMP PRO application. All is runing ok in Frontend but when I try to login to the backend there is a redirection that doesn't allow me to be authenticated. The DB is exactly the same, so the user should be authenticated.
When I type user and password and the hit send the screen shows:
Redirecting to http://localhost/admin/dashboard
Then the screen refresh again and shows:
Redirecting to http://localhost/admin/auth/login
I have think that maybe it is related to the Session, but it is stablished to:
'driver' => env('SESSION_DRIVER', 'file'),
So I do not know why this can be a reason. Any idea?
UPDATE - I include a summary of routes.php
This is my routes.php file (chunks of it)
// Admin area
Route::get('admin', function () {
return redirect('/admin/dashboard');
});
Route::group([
'namespace' => 'App\Http\Controllers\Admin',
'middleware' => 'auth.admin',
], function () {
Route::get('admin/dashboard' , 'AdminController#index');
});
Route::get('admin/auth/login', 'App\Http\Controllers\Admin\Auth\AuthController#login');
It sounds like your routes aren't in the web middleware. Make sure all the routes that require cookies or the session are defined like this:
Route::group(['middleware' => ['web']], function() {
Route::get('your-route-here', 'SomeController#method');
});
This is a new feature in Laravel 5.2.
I have just installed fresh laravel 5.1, only root page is showing that
Route::get('/', function () {
return view('welcome');
});
It's working perfectly but rather than any other route not working
like:
Route::get('user', function () {
return "hello";
});
It throws exception 404 not found. Please help me to get out from this. Thanks in advance.
It may be because of rewrite mode is not enabled in your system. Either you enable it or access through the following url with index.php
http://localhost/blog/public/index.php/user
My laravel application was working very fine, until I installed entrust.
Now, all my routes which are grouped gives me 500 server error. However, the route when placed out of group gives me the desired result.
Route::get('ticker', 'UsersController#index');
This gives me perfect result.
However, this doesn't.
Route::group(['prefix' => 'api/v1'], function() {
Route::get('ticker', 'UsersController#index');
});
What has gone wrong? I am unable to figure out. I also tried logging errors in apache, but doesn't give me a error in the log file.