1. Go to this page and download the library: Download robbevw/pseudo 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/ */
Auth::check() // true if User false if Pseudo/Contracts/GuestContract
Auth::user() // returns instance of Pseudo/Contracts/GuestContract instead of null if no user found
@can() // no longer automatically fails if not authenticated, allows Gate to be checked
public function register()
{
$this->app->bind(GuestContract::class, Guest::class);
}
class GuestUser extends User implements GuestContract
{
//Here you amy overload anything to be specific to your guest user
public function getNameAttribute(){
return 'Guest User';
}
}