PHP code example of elitedevsquad / sidecar-laravel

1. Go to this page and download the library: Download elitedevsquad/sidecar-laravel 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/ */

    

elitedevsquad / sidecar-laravel example snippets


public function boot(): void
{
    if (class_exists(\EliteDevSquad\SidecarLaravel\Sidecar::class)) {
        \EliteDevSquad\SidecarLaravel\Sidecar::$userMap = [
            'id'    => 'id',
            'name'  => 'first_name',
            'role'  => 'role.name',
            'email' => 'email',
        ];

        \EliteDevSquad\SidecarLaravel\Sidecar::$userBuilder = \App\Models\User::with('role');
    }
}