1. Go to this page and download the library: Download sizuhiko/cake_fabricate 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/ */
sizuhiko / cake_fabricate example snippets
use Fabricate\Fabricate;
use CakeFabricate\Adaptor\CakeFabricateAdaptor;
Fabricate::config(function($config) {
$config->adaptor = new CakeFabricateAdaptor();
});
$results = Fabricate::attributes_for('Posts', 10, function($data){
return ["created" => "2013-10-09 12:40:28", "updated" => "2013-10-09 12:40:28"];
});
// $results is array followings :
array (
0 =>
array (
'title' => 'Lorem ipsum dolor sit amet',
'body' => 'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida, phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit, feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis.',
'created' => '2013-10-09 12:40:28',
'updated' => '2013-10-09 12:40:28',
),
1 =>
array (
....