O'Reilly logo

Learning Laravel 4 Application Development by Hardik Dangar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a login section for the administrator

Now as we have the basic code for managing the admin section, let's create a login section for the site. But first, we need to set up the layout for the admin section. So let's do that first. First, add a route to our login page as follows:

Route::controller('admin','admin');

Now let's add our admin Controller code with the login method:

class AdminController extends BaseController {

    public function getLogin()
    {
        return View::make('layouts.login')->with('title','Foldagram - Admin');
    }
}

Here, we are loading our login view from the layouts directory. So let's add the login layout file in our Views directory:

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>{{ $title }}</title> <?php ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required