2017 © Pedro Peláez
 

package ajaxlogin

Ajax login for laravel ...

image

5dmatweblogin/ajaxlogin

Ajax login for laravel ...

  • Friday, February 24, 2017
  • by zizohassan
  • Repository
  • 2 Watchers
  • 4 Stars
  • 866 Installations
  • HTML
  • 0 Dependents
  • 0 Suggesters
  • 7 Forks
  • 1 Open issues
  • 1 Versions
  • 15 % Grown

The README.md

laravel-ajax-login

laravel ajax login row javascript, (*1)

video

Video here, (*2)

installtion

add this command to terminal in linux or mac & cmd on windows, (*3)

composer require 5dmatweblogin/ajaxlogin:dev-master

Add provider

open config/app.php add this line on providers array, (*4)

AjaxLogin\AjaxLoginProvider\AjaxLoginProvider::class,

Authentication scaffolding

add this line to terminal, (*5)

php artisan make:auth

Publish Vendors

not last step to add this line we write on login.blade.php & app.blade.php & logincontroller.php & add new file on public path /public/AjaxLogin/AjaxLogin.js, (*6)

php artisan vendor:publish --tag=5dmatweb --force

Start Now

now start your project and enjoy login with ajax, (*7)

php artisan serve

How to use

we set for you every thing on login file and app layout file this is the basic, (*8)

  AL = new Login({
            email:"email",
            password:"password",
            btn:"btn",
            url:"/login", ///where we post the form data
            successUrl:"/",/// url to redirect after login /home is the default
            mode:"toast" ///alert or toast
});

email => set the email id field
password => set the password id field
btn => set the submit button id field
url => the login post url it set by default to /login
successUrl => the url we will redirect user after success login By default we rediret to home page
mode => the error way to show we have to mode on sample alert Or toast alert
, (*9)

Methods

Done login

we have method called doneLogin this method process after user is login you can add your custom logic here if you want the default action to rediret to home or if you set successUrl property the lib will redirect user to this url, (*10)

AL.doneLogin = function(){
            alert('login');
        };

Error login

we have method called errorLogin this method process if user have error in login like wrong login info add your custom logic here if you want , the default action to show user error in depend on user mode select you can run your custom error show if you want the function will return with error that laravel pass, (*11)

  AL.errorLogin = function (error) {
            console.log(error)
        };

The Versions

24/02 2017

dev-master

9999999-dev

Ajax login for laravel ...

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

laravel javascript ajax login