1. Go to this page and download the library: Download laratusk/pictomock 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/ */
laratusk / pictomock example snippets
use Laratusk\PictoMock\PictoMock;
// Fluent API
$path = PictoMock::make()
->width(400)
->height(300)
->format('png')
->save('/tmp/images');
// Static one-liner
$path = PictoMock::generate('/tmp/images', 400, 300, 'png');
// SVG — no GD needed
$path = PictoMock::make()->format('svg')->width(800)->height(600)->save('/tmp');
// With dimension text overlay
$path = PictoMock::make()->format('png')->width(300)->height(200)->withText()->save('/tmp');
use Laratusk\PictoMock\Laravel\PictoMockFacade as PictoMock;
// or with the alias:
use PictoMock;
$path = PictoMock::make()->format('svg')->width(400)->height(300)->save(storage_path('app/images'));
// app/Providers/AppServiceProvider.php
use Laratusk\PictoMock\Faker\PictoMockFakerProvider;
public function register(): void
{
$this->app->extend(\Faker\Generator::class, function ($faker) {
$faker->addProvider(new PictoMockFakerProvider($faker, storage_path('app/pictomock')));
return $faker;
});
}