PHP code example of uzbek / laravel-attribute-scanner

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

    

uzbek / laravel-attribute-scanner example snippets

)
[//]: # (return [)
[//]: # (];)
[//]: # (

use Uzbek\LaravelAttributeScanner\Facades\AttributeScanner;

$attributes = AttributeScanner::getAttributes(asArray: true);

// or

use Uzbek\LaravelAttributeScanner\LaravelAttributeScanner;

$scanner = new LaravelAttributeScanner(directories: ['app/Models', 'app/Http/Controllers']);
$attributes = $scanner->getAttributes();

[
    "App\Http\Controllers\UserController@create" => [{...},{...}], #Uzbek\LaravelAttributeScanner\Attribute[],   (method)
    "App\Http\Controllers\UserController@update>id" => [{...}], #Uzbek\LaravelAttributeScanner\Attribute[],   (parameter)
    "App\Http\Controllers\UserController.service" => [{...}], #Uzbek\LaravelAttributeScanner\Attribute[],   (property)
]

[
    "App\Http\Controllers\UserController@create" => [
        [
            "class" => "App\Http\Controllers\UserController",
            "method" => "create",
            "target" => "method",
            "name" => "Uzbek\LaravelValidationAttributes\Attributes\Validators",
            "arguments" => [
                [
                    "name" => "",
            "name" => "Uzbek\SomeAttributes\ID",
            "arguments" => [],
        ]
    ],
    "App\Http\Controllers\UserController.service" => [
        [
            "class" => "App\Http\Controllers\UserController",
            "target" => "property",
            "property" => "service",
            "name" => "Uzbek\SomeAttributes\Readonly",
            "arguments" => [],
        ]
    ],
    "App\Http\Controllers\UserController:IS_PUBLIC" => [
        [
            "class" => "App\Http\Controllers\UserController",
            "target" => "constant",
            "constant" => "IS_PUBLIC",
            "name" => "Uzbek\SomeAttributes\Casts\Integer",
            "arguments" => [],
        ]
    ],
    ...
]
bash)
[//]: # (php artisan vendor:publish --tag="laravel-attribute-scanner-config")
[//]: # (