1. Go to this page and download the library: Download skie/cakephp-factory-muffin 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/ */
skie / cakephp-factory-muffin example snippets
namespace App\Model\Factory;
use CakephpFactoryMuffin\Model\Factory\AbstractFactory;
use League\FactoryMuffin\Faker\Facade as Faker;
class UsersFactory extends AbstractFactory {
public function definition()
{
return [
'first_name' => Faker::firstName(),
'last_name' => Faker::lastName(),
'username' => function ($object, $saved) {
return strtolower($object['last_name'] . '_' . $object['first_name']);
},
'password' => Faker::word(),
];
}
}