PHP code example of arietimmerman / laravel-scim-server

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

    

arietimmerman / laravel-scim-server example snippets


return [
    // Base path for all SCIM routes
    'path' => env('SCIM_BASE_PATH', '/scim'),

    // Optional domain to restrict SCIM endpoints to
    'domain' => env('SCIM_DOMAIN', null),

    // Middleware for protected routes (resource operations)
    'middleware' => env('SCIM_MIDDLEWARE', []),

    // Middleware for public routes (ServiceProviderConfig, Schemas, ResourceTypes)
    'public_middleware' => env('SCIM_PUBLIC_MIDDLEWARE', []),

    // Omit the main schema namespace from resource responses
    'omit_main_schema_in_return' => env('SCIM_OMIT_MAIN_SCHEMA_IN_RETURN', false),
    
    // Omit attributes with null values from responses
    'omit_null_values' => env('SCIM_OMIT_NULL_VALUES', true),
];

// config/scim.php
return [
    'publish_routes' => false,
    // other config...
];

// In your RouteServiceProvider or a custom service provider:
ArieTimmerman\Laravel\SCIMServer\RouteProvider::routes([
    'path' => '/custom-scim',
    'domain' => 'api.example.com',
    'middleware' => ['api', 'auth:api', 'scoped-tokens'],
    'public_middleware' => ['api', 'rate-limit'],
]);

$this->app->singleton(
    \ArieTimmerman\Laravel\SCIMServer\SCIMConfig::class,
    YourCustomSCIMConfig::class
);



class YourCustomSCIMConfig extends \ArieTimmerman\Laravel\SCIMServer\SCIMConfig
{
    public function getUserConfig()
    {
        $config = parent::getUserConfig();

        // Customize $config as needed.

        return $config;
    }
}

'pagination' => [
    'defaultPageSize' => 10,
    'maxPageSize' => 100,
    'cursorPaginationEnabled' => false,
]

// config/scim.php
return [
    'middleware' => ['api', 'auth:sanctum'], // For protected resource routes
    'public_middleware' => ['api'],          // For schema/discovery endpoints
];

// config/scim.php
return [
    'publish_routes' => false,
];

use ArieTimmerman\Laravel\SCIMServer\RouteProvider as SCIMServerRouteProvider;

SCIMServerRouteProvider::publicRoutes([
    'path' => '/scim',
    'middleware' => ['api'],
]);

Route::middleware('auth:api')->group(function () {
    SCIMServerRouteProvider::routes([
        'path' => '/scim',
        'middleware' => ['custom-scim-check'],
        'public_routes' => false,
    ]);

    SCIMServerRouteProvider::meRoutes();
});
bash
php artisan vendor:publish --tag=laravel-scim
bash
php artisan vendor:publish --tag=laravel-scim-migrations
php artisan migrate