zizohassan / laravel-ajax-login by zizohassan

Ajax login for laravel ...
1,944
7
2
Package Data
Maintainer Username: zizohassan
Maintainer Contact: admin@5dmat-web.com (5dmatweb Team)
Package Create Date: 2017-02-23
Package Last Update: 2017-02-24
Language: HTML
License: MIT
Last Refreshed: 2024-04-23 03:05:05
Package Statistics
Total Downloads: 1,944
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 7
Total Watchers: 2
Total Forks: 8
Total Open Issues: 2

laravel-ajax-login

laravel ajax login row javascript

#video Video here

#installtion add this command to terminal in linux or mac & cmd on windows

composer require 5dmatweblogin/ajaxlogin:dev-master

#Add provider open config/app.php add this line on providers array

AjaxLogin\AjaxLoginProvider\AjaxLoginProvider::class,

#Authentication scaffolding add this line to terminal

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

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

#Start Now now start your project and enjoy login with ajax

php artisan serve

#How to use we set for you every thing on login file and app layout file this is the basic

  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

#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

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

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