dimanche 19 juin 2016

Laravel 5.1 - Route doesnt work

i have a problem with routes, i have my route:

Route::get('blog', 'FrontController@blog');

and my FrontController:

public function blog()
    {

        $articles = Article::OrderBy('id','DESC')->paginate(3);
        $Allarticles = Article::OrderBy('id','DESC')->get();
        $Allcategories = BlogCategory::OrderBy('id','DESC')->get();
        $Alltags = Tag::OrderBy('id','DESC')->get();
        $Allcomments = Comment::OrderBy('id','DESC')->take(3)->get();

        return view('blog', compact('articles','Alltags','Allarticles','Allcategories','Allcomments'));
    }

if i go to "http://localhost:8000/blog" it return to page where i was before. similar to route->back().

I dont know why i have this problem, other blog routes work well.

I done some test like this:

public function blog()
        {
            return "Hi";

        }

it doesnt return "Hi", so i think is a problem with the route. i have not anable middleware here, my other routes like blog/article work well.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire