jadjoubran / laravel5-angular-material-starter

Get started with Laravel 5.3 and AngularJS (material)
https://laravel-angular.readme.io/
MIT License
1.66k stars 400 forks source link

Need an example of logout functionality #372

Closed avastamin closed 8 years ago

avastamin commented 8 years ago

Sorry, I new and I am looking for an example of logout functionality. How I can add a simple logout button and redirect to login page after logout out.

Thanks in advance.

jadjoubran commented 8 years ago

Hi @avastamin You can just have a regular logout method like this:

  logout() {
    this.$localStorage.$reset();
    this.$state.go('app.landing');
  }

In this example, I chose to clear out the localstorage values but that might not be ideal for your application

Let me know if it works for you

avastamin commented 8 years ago

Thanks. I want to integrate ui calendar but not sure how to add custom angular code like this: https://github.com/angular-ui/ui-calendar/blob/master/demo/calendarDemo.js

Your support would really help a lot.

jadjoubran commented 8 years ago

For package specific help that are not part of this starter, I'd recommend the gittr chat room