PHP code example of free2one / laravel-php-accessor

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

    

free2one / laravel-php-accessor example snippets



namespace App;

use PhpAccessor\Attribute\Data;

#[Data]
class Entity
{
    private int $id;

    private int $sex;
}


declare(strict_types=1);

use Psr\Log\LogLevel;

return [
    'is_dev_mode' => false,
    'scan_directories' => [
        'app',
    ],
    'proxy_root_directory' => '.php-accessor',
    'gen_meta' => env('APP_ENV') == 'local' ? 'yes' : 'no',
    'gen_proxy' => 'yes',
    'log_level' => LogLevel::DEBUG,
];
console
php artisan vendor:publish --tag=php-accessor
json
{
  "scripts":{
    "php-accessor": "@php vendor/bin/php-accessor generate"
  }
}