laravel_auth_slate 1.0.0
laravel_auth_slate: ^1.0.0 copied to clipboard
Laravel authentication package, creates a login, signup and api service using Sanctum.
Laravel Auth Slate #
Scaffolds an authentication UI in your Nylo project.
Getting Started #
In your Flutter project add the dependency:
With Dart:
dart pub add laravel_auth_slate
This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get):
dependencies:
...
laravel_auth_slate: ^1.0.0
Usage #
Step 1: Run the below command in your project.
dart run laravel_auth_slate:main publish:all
With Nylo
dart run nylo_framework:main publish:slate laravel_auth_slate
Step 2: Go to config/events.dart
and update the following event:
// from
SyncAuthToBackpackEvent: SyncAuthToBackpackEvent<User>(),
// to
SyncAuthToBackpackEvent: SyncAuthToBackpackEvent<LaravelAuthResponse>(),
Routes #
The initial route should be AuthLandingPage
.
Go to your routes/router.dart
file and update the following:
appRouter() => nyRoutes((router) {
...
router.route(AuthLandingPage.path, (context) => AuthLandingPage(), initialRoute: true); // set to initial route
});
Install the Laravel composer package #
You can install the package via composer:
composer require nylo/laravel-nylo-auth
You can publish and run the migrations with:
php artisan vendor:publish --provider="Nylo\LaravelNyloAuth\LaravelNyloAuthServiceProvider"
Check out the Laravel package here for more information.
Requirements #
- Dart >= 2.19.0
- Flutter >= 3.10.0
Files generated: #
- Pages
- LoginPage
- RegisterPage
- LandingPage
- DashboardPage
- AuthLandingPage
- Controllers
- LoginController
- RegisterController
- ForgotPasswordController
- Events
- LaravelAuthEvent
- Networking
- LaravelApiService
- LaravelAuthService
- Models
- AuthUser
- AuthResponse
Changelog #
Please see CHANGELOG for more information what has changed recently.
Licence #
The MIT License (MIT). Please view the License File for more information.