1

From the title itself, I have a weird Laravel bug. I have test page for my home page which has a route name of "main". It works perfectly fine. However, when I tried to change it from route::get("main") to route::get("/") I end up with a white page. No errors, when I view source, no code or whatsoever. I am running Laravel 5.6

// Landing Page actual Route
// White Page 

Route::get('/', function () {
    return view('templates.landing-blank');
});

// Landing Page
// Works Perfectly.

Route::get('main', function() {
    return view('templates.landing-blank');
});

Is this something related to htaccess? I already doubled checked everything and copied the htaccess but still no avail. I also did a composer update and the problems still persist.

drake24
  • 525
  • 1
  • 11
  • 32
  • 1
    Try to clear the cahce by `php artisan route:clear`, `php artisan config:clear` and `php artisan cache:clear`. And give write permission to `bootstrap/cache` and `storage` directories. @drake24 – Zane Sep 02 '18 at 03:31
  • @Zane still doesn't work.By bootstrap/cache and storage perfectly works. It – drake24 Sep 02 '18 at 04:19

2 Answers2

0

The first parameter of the Route::get should be the the url path to access the page, so "main" would be accessed by example.com/main and "/" would be just example.com. Could that be the problem?

GMachado
  • 791
  • 10
  • 24
  • I got your point. It works perfectly fine, but I need a route that doesn't have any text. only the "root" which is "/" and yes. "/" is www.example.com. And it seems it returns a white page :( – drake24 Sep 02 '18 at 04:22
  • Oh okay, yeah that's weird, with www.example.com/main you said it's working fine? – GMachado Sep 02 '18 at 04:41
0

Can you go to .env and change the label APP_DEBUG to "true"? Maybe you can see the error.

And I think you need to add a "/" to the "main" route. Like that:

Route::get('/main', function() {
    return view('templates.landing-blank');
});
  • I got your point. It works but I need a route that doesn't have any text. only the "root" which is "/" – drake24 Sep 02 '18 at 04:20
  • But I think if you do this: Route::get('/', function () { return view('templates.landing-blank'); }); Route::get('/main', function() { return view('templates.landing-blank'); }); – Cayo Henrique Rodrigues Sep 03 '18 at 00:28