500 Internal server error in Laravel for every route - php

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.

Related

404 error when adding a different route - Laravel dead simple routing

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

ERR_TOO_MANY_REDIRECTS Laravel on server

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

API url not found on server error

I have deployed an API built using lumen 5.4 on shared hosting. I'm able to hit the the main domain elomena.xyz but cannot access elomena.xyz/users
Local server test with postman is successful but I get this error when i try to reach it from production environment
Not Found
The requested URL /users was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
This is the content of my web.php file
$app->get('/', function () use ($app) {
return $app->version();
});
// Users
$app->get('/users', 'UserController#index');
$app->post('/users', 'UserController#store');
$app->get('/users/{user_id}', 'UserController#show');
$app->put('/users/{user_id}', 'UserController#update');
$app->delete('/users/{user_id}', 'UserController#destroy');
// Orders
$app->get('/orders', 'OrderController#index');
$app->post('/orders', 'OrderController#store');
$app->get('/orders/{order_id}', 'OrderController#show');
$app->put('/orders/{order_id}', 'OrderController#update');
$app->delete('/orders/{order_id}', 'OrderController#destroy');
I can't find the reason why I can get to elomena.xyz but not elomena.xyz/users in production environment. I need help as i have been on this for over 48hrs already.

Laravel 4 - NotFoundHttpException only for NEW Routes

I've picked up a project that was developed using Laravel 4.2. I've deployed it to my testing server (a Bitnami LAMP) and everything works as it's supposed to. HOWEVER, new routes that I create don't work, getting the error NotFoundHttpException.
I've gone through a few recommendations, but nothing has been successful thus far.
Any thoughts or ideas??
Thanks!
--
Just to clarify, any NEW route throws the same Not Found error. Even the simplest one like:
Route::get('test', function(){
return "This is a test";
});
It seems like Laravel is only serving an old version of the Routes.php, is this even possible???
Resolved this by recreating the project using Laravel 5 instead.

Laravel: Routing Not Working

I googled the matter and there are many who've had this issue, but each had his own very unique case, and at the end nothing I read helped me.
I just finished installing Laravel with xampp, hopefully properly. Apache and MySQL are running.
I'm starting with the very first tutorial:
http://laravel.com/docs/4.2/quick#routing
My app root is:
http://localhost/Laravel/tests/app/
The hello.php file is working for me, I even tested some php code (plain not laravel) and it worked:
http://localhost/Laravel/tests/app/views/hello.php
As the tutorial instructed, I added in app/routes.php:
Route::get('users', function()
{
return 'Users!';
});
but when I try to access
http://localhost/Laravel/tests/app/views/users
I get "Object not found!" while I should be getting the text "Users!"
This is not route correct, test with: http://localhot/Laravel/tests/public/users

Categories