PHP code example of lkovace18 / entity-factory-bundle

1. Go to this page and download the library: Download lkovace18/entity-factory-bundle 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/ */

    

lkovace18 / entity-factory-bundle example snippets


$factory->create(User::class);


$factory->times(10)->create(Beer::class);

/* This will generate 10 persisted beers with fake values */

$user = $factory->create(
    User::class, 
    [
        'username' => 'BadassAdmin'
        'active'   => true
    ]
);

$post = $factory->make(User::class)

$productData = $factory->values(User::class);