0
|--------------------------------------------------------------------------
| URLs
|--------------------------------------------------------------------------
|
| Register here your dashboard, logout, login and register URLs. The
| logout URL automatically sends a POST request in Laravel 5.3 or higher.
| You can set the request to a GET or POST with logout_method.
| Set register_url to null if you don't want a register link.
|
*/

'dashboard_url' => 'home',

'logout_url' => 'logout',

'logout_method' => null,

'login_url' => 'login',

'register_url' => 'register',

please help me with my problem, i am a newbie in terms of programming i need help regarding to the URL/Routes of the admin LTE, i cannot find the routes admin LTE using, and can anyone explain what is the uses of each parameters above thanks.

Ace.D
  • 1
  • 1
  • 1
  • The keys are used internally in the Admin LTE code and the values are probably route paths. You must define the paths that correspond to your site's structure: What is your dashboard route path ? – Paperclip Mar 17 '17 at 15:09
  • Klamberext, Route::get('/home', 'HomeController@index'); this is the only route i have. which i dont' understand how admin routes and URI works. i just think that the right side is the URI/URL and i don't know how the parameters on the left side works and where do i can find them. – Ace.D Mar 17 '17 at 15:27
  • I assume the Admin LTE theme work allready and you can see the Login, Log Out and Dashboard links ? As I understand the *'dashboard_url' => 'home'* would mean "/home" url. "dashboard_url" is probably used somewhere in the view files to genearte the link URL's for buttons etc... Logout method switches between POST and GET. Default POST in this case secures from URL hijacking. – Paperclip Mar 17 '17 at 15:53
  • thanks for the answer Klamberext, i think i got the answer somehow. but i need to explore more of admin LTE syntax and configuration. correct me if i'm wrong sir am 'dashboard_url' work just like a class? that can i call in my blade.php file? thanks – Ace.D Mar 17 '17 at 16:01
  • URL Hijacking is the wrong term here. It actually prevent direct link from changing anything - GET should just get. Also POST secures from URL prefetching. – Paperclip Mar 17 '17 at 16:02
  • No. I think the "dahboard_url" is just a key/value pair in Admin LTE's configuration array. It is most likely used as config('adminlte.dashboard_url') or smth. Just a guess on the names here :) – Paperclip Mar 17 '17 at 16:05
  • If it is in config directory, then see Laravl's documentation on how the config() works. – Paperclip Mar 17 '17 at 16:07
  • I got lot of stuff from you sir, thanks for all the ideas and suggestion you've given to me. – Ace.D Mar 17 '17 at 16:09
  • I'm so confused how to use ADMIN LTE sir, It actually prevent direct link from changing anything - GET should just get. Also POST secures from URL prefetching. – Klamberext 8 mins ago you mean by this sir, that all of the request and process must need to go trhough my controller right?? P.S: sorry for asking a rude and broad questions sir I'm just really a newbie in terms of programming. but thank you so much. – Ace.D Mar 17 '17 at 16:14
  • Don't worry about the POST and GET. http://stackoverflow.com/questions/3521290/logout-get-or-post Maybe get more familiar with the programming without the Laravel overhead and just start by creating your small site using PHP. Then gradually try to create simple site on Laravel or any other framework and If you feel you can try again the Admin LTE theme. It's just a skin built on top of the Laravel, using PHP programming language. Master them and you'll master the Admin LTE. – Paperclip Mar 17 '17 at 16:25

1 Answers1

0

I'll speak quickly and briefly:

'dashboard_url' => 'home'

dashboard_url: Here will be your main application page, will set the first page. Based on your configuration URLs, from this depends on which technology you are using to define these routes. I myself use Laravel, so I need to define my routes in routes/web.php.

'logout_url' => 'logout'

logout_url: Where you will be directed after you leave

'login_url' => 'login'

login_url: Your login page

'register_url' => 'register'

register_url: | You can set the request to GET or POST with logout_method. | Set register_url to null if you do not want to register link. (I have not used this yet, sorry)

Example:

Here you define your routes and when using in laravel then will call according to the configurations of AdminLTE

My route

$this->group(['middleware' => ['auth'], 'namespace' => 'Admin'], function(){
    $this->get('/', 'AdminController@index')->name('admin.home');   
});

My index

(My logout)

                          <li class="user-footer">
                            <div class="float-left">
                              <a href="#" class="btn btn-default btn-flat">Perfil</a>
                            </div>
                            <div class="float-right">
                                <a href="#" class="btn btn-default btn-flat"
                                   onclick="event.preventDefault(); document.getElementById('logout-form').submit();" >
                                    {{ trans('adminlte::adminlte.log_out') }}
                                </a>
                                <form id="logout-form" action="{{ url(config('adminlte.logout_url', 'auth/logout')) }}" method="POST" style="display: none;">
                                    @if(config('adminlte.logout_method'))
                                        {{ method_field(config('adminlte.logout_method')) }}
                                    @endif
                                    {{ csrf_field() }}
                                </form>                                      
                            </div>
                          </li>