samedi 25 juin 2016

Laravel 5 ERROREXCEPTION in routes.php

With Laravel 5 routing I came up with an issue of ERROREXCEPTION error.My site had authentication.I want to see a nice url like domain/home/record.But it failed to find the route.I used blade files but could not link to route.Here is the code below:

In routes.php

 Route::get('/home/record', function(){
return view(users.record);
})->name('record');

Route::group(['middleware' => ['web']], function () {
Route::get('/', ['as' => 'login', 'uses' => 'AuthController@login']);
Route::post('/handleLogin', ['as' => 'handleLogin', 'uses' => 'AuthController@handleLogin']);
Route::get('/home', ['middleware' => 'auth', 'as' => 'home', 'uses' => 'UsersController@home']);
Route::get('/logout', ['as' => 'logout', 'uses' => 'AuthController@logout']);

Route::resource('users', 'UsersController');
});


And this is home.blade.php




<!DOCTYPE html>
<html>
<head>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="" type="text/css" />
    <link rel="stylesheet" type="text/css" href="">

    <!-- @yield('styles') -->
</head>
<body>  



<div class="wrapper">




 <div class="sidebar" data-color="purple" data-image="src/img/sidebar-5.jpg">



    <div class="sidebar-wrapper">
        <div class="logo">
            <a href="http://www.zipcyber.com" class="simple-text">
                ZIP CYBER
            </a>
        </div>

        <ul class="nav">
            <li class="active">
                <a href="dashboard.html">
                    <i class="pe-7s-graph"></i>
                    <p>Dashboard</p>
                </a>
            </li>
            <li>
                

                    <!-- <i class="pe-7s-user"></i>
                    <p>Add Record</p> -->
                </a>
            </li>
            <li>
                <a href="#">
                    <i class="pe-7s-note2"></i>
                    <p>Table List</p>
                </a>
            </li>
            <li>
                <a href="typography.html">
                    <i class="pe-7s-news-paper"></i>
                    <p>Typography</p>
                </a>
            </li>
            <li>
                <a href="icons.html">
                    <i class="pe-7s-science"></i>
                    <p>Icons</p>
                </a>
            </li>
            <li>
                <a href="maps.html">
                    <i class="pe-7s-map-marker"></i>
                    <p>Maps</p>
                </a>
            </li>
            <li>
                <a href="notifications.html">
                    <i class="pe-7s-bell"></i>
                    <p>Notifications</p>
                </a>
            </li>
            <li class="active-pro">
                <a href="upgrade.html">
                    <i class="pe-7s-rocket"></i>
                    <p>Upgrade to PRO</p>
                </a>
            </li>
        </ul>
    </div>
 </div>

 <div class="main-panel">

      <nav class="navbar navbar-default navbar-fixed">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navigation-example-2">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <!-- <a class="navbar-brand" href="#">Dashboard</a> -->
            </div>


                <ul class="nav navbar-nav navbar-right">
                    <li>
                       <a href="">
                           
                        </a>
                    </li>
                    <li class="dropdown">
                          <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                Dropdown
                                <b class="caret"></b>
                          </a>
                          <ul class="dropdown-menu">
                            <li><a href="#">Action</a></li>
                            <li><a href="#">Another action</a></li>
                            <li><a href="#">Something</a></li>
                            <li><a href="#">Another action</a></li>
                            <li><a href="#">Something</a></li>
                            <li class="divider"></li>
                            <li><a href="#">Separated link</a></li>
                          </ul>
                    </li>
                    <li>

                            

                    </li>
                </ul>

        </div>
    </nav>




      <div class="content">
        @yield('content')    
     </div>
   </div>
</div>
</body>
</html>



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/28SX5Uc
via IFTTT

Aucun commentaire:

Enregistrer un commentaire