PHP code example of laraverse / laravel-auth

1. Go to this page and download the library: Download laraverse/laravel-auth library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

laraverse / laravel-auth example snippets


use Illuminate\Auth\MustVerifyEmail;
use Illuminate\Contracts\Auth\MustVerifyEmail as MustVerifyEmailContract;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Laravel\Sanctum\HasApiTokens;
use Laraverse\LaravelAuth\Concerns\HasUserPermissions;
use Spatie\Permission\Traits\HasRoles;

class User extends Authenticatable implements MustVerifyEmailContract
{
    use HasApiTokens, HasRoles, SoftDeletes, HasUserPermissions, MustVerifyEmail;
}

'guards' => [
    'sanctum' => [
        'driver' => 'sanctum',
        'provider' => 'users',
    ],
],

'providers' => [
    'users' => [
        'driver' => 'eloquent',
        'model' => \App\Models\User::class,
    ],
],
bash
composer publish:sanctum-auth --force
php artisan migrate
php artisan db:seed --class=Database\\Seeders\\LaravelAuthSeeder
composer remove laraverse/laravel-auth
bash
php artisan publish:sanctum-auth --force
php artisan publish:sanctum-auth --force --migrate --seed
bash
php artisan db:seed --class=Database\\Seeders\\LaravelAuthSeeder