PHP code example of vgirol / jsonapi-faker-laravel
1. Go to this page and download the library: Download vgirol/jsonapi-faker-laravel 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/ */
vgirol / jsonapi-faker-laravel example snippets
use VGirol\JsonApiFaker\Laravel\Generator as JsonApiFaker;
$faker = new JsonApiFaker;
$model = new DummyModel();
$factory = $faker->resourceObject($model, 'resourceType');
use VGirol\JsonApiFaker\Generator as JsonApiFaker;
$model = new DummyModel();
$json = new JsonApiFaker()
->resourceObject($model, 'resourceType')
->setMeta([
'key1' => 'meta1'
])
->toJson();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.