PHP code example of n2boost / laravel-doctrine-mapping

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

    

n2boost / laravel-doctrine-mapping example snippets


'providers' => [
    // ...
    N2boost\LaravelDoctrineMapping\LaravelDoctrineMappingServiceProvider::class,
];

return [

    /*
     * Mapping Config Engines.
     * Can set to: yaml
     */

    'mapping_type' => 'yaml',

    /*
     * Mapping config files dir
     * full path will like this example: config/mappings/yaml/User.dcm.yml
     */
    'mapping_file_dir' => 'config/mappings',

    'entities_file_dir' => 'resources/classes',

    'profile' => 'local',
    'isDevMode' => true,

    'use_connection_pool' => 'laravel', // laravel, self
    'connection' => 'mysql',

    'connections' => [
        'mysql' => [
            'driver' => 'pdo_mysql',
            'host' => '127.0.0.1',
            'port' => 3306,
            'user' => 'root',
            'password' => '',
            'dbname' => 'hunter',
            'charset' => 'utf8mb4',
            'collate' => 'utf8mb4_unicode_ci',
        ]
    ]
];
bash
php artisan vendor:publish --provider="N2boost\LaravelDoctrineMapping\LaravelDoctrineMappingServiceProvider::class" --tag="config"
bash
php artisan vendor:publish

php artisan n2boost:orm:generate-entities

php artisan n2boost:orm:scheme-tool:update