dev-master
9999999-devAjax login for laravel ...
MIT
The Requires
- php >=5.4.0
laravel javascript ajax login
Ajax login for laravel ...
laravel ajax login row javascript, (*1)
Video here, (*2)
add this command to terminal in linux or mac & cmd on windows, (*3)
composer require 5dmatweblogin/ajaxlogin:dev-master
open config/app.php add this line on providers array, (*4)
AjaxLogin\AjaxLoginProvider\AjaxLoginProvider::class,
add this line to terminal, (*5)
php artisan make:auth
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
now start your project and enjoy login with ajax, (*7)
php artisan serve
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)
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'); };
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) };
Ajax login for laravel ...
MIT
laravel javascript ajax login