1. Go to this page and download the library: Download wamesk/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/ */
wamesk / laravel-auth example snippets
'providers' => [
...
/*
* Third Party Service Providers...
*/
\Wame\LaravelAuth\LaravelAuthServiceProvider::class,
];
namespace App\Models;
use Illuminate\Database\Eloquent\Concerns\HasUlids;
use Wame\LaravelAuth\Models\BaseUser;
class User extends BaseUser
{
use HasUlids;
}
'guard' => 'api', // Change value to 'api'
'password_grant_client' => [ // Password Grant Client - Login/Registration
'id' => env('PASSPORT_PASSWORD_GRANT_CLIENT_ID'),
'secret' => env('PASSPORT_PASSWORD_GRANT_CLIENT_SECRET'),
],
'personal_access_client' => [ // Personal Access Client - Social
'id' => env('PASSPORT_PERSONAL_ACCESS_CLIENT_ID'),
'secret' => env('PASSPORT_PERSONAL_ACCESS_CLIENT_SECRET'),
],
$table->bigIncrements('id');
$table->string('log_name')->nullable();
$table->text('description');
$table->nullableUlidMorphs('subject', 'subject'); // <-- Change to this value
$table->nullableUlidMorphs('causer', 'causer'); // <-- Change to this value
$table->json('properties')->nullable();
$table->timestamps();
$table->index('log_name');
'order_column_name' => 'sort_order',
use Illuminate\Validation\Rules\Password;
return [
// User Model
'model' => \Wame\LaravelAuth\Models\BaseUser::class,
/* Login Options */
'login' => [
// Determine if login should be possible.
'enabled' => true,
// Enable this if only verified users can log in.
'only_verified' => false,
// Additional parameters to login request
'additional_body_params' => [
// Example: 'app_version' => '
->symbols()
->uncompromised(),
'confirmed'
],
// Additional parameters to register request
'additional_body_params' => [
// Example: 'app_version' => '
class AuthController extends LaravelAuthController
{
/*
Here will be the documentation for register
*/
public function register(Request $request): JsonResponse
{
return parent::register($request);
}