27/04
2017
Wallogit.com
2017 © Pedro Peláez
Generate file from stub, (*2)
composer require goszowski\stub
<?php
use Goszowski\Stub\Stub;
$stub = new Stub;
$stub->load('/path/to/stub/file');
$stub->replace('some_1', 'other_1');
$stub->replace('some_2', 'other_2');
// OR WITH ARRAY
$stub->replace([
'some_1' => 'other_1',
'some_2' => 'other_2',
]);
$stub->store('/path/to/save/file', 'filename');
<?php
namsepace App\YourNamespace;
use Facades\ {
Goszowski\Stub\Stub
};
$stub = Stub::load('/path/to/stub/file');
$stub->replace('some_1', 'other_1');
$stub->replace('some_2', 'other_2');
// OR WITH ARRAY
$stub->replace([
'some_1' => 'other_1',
'some_2' => 'other_2',
]);
$stub->store('/path/to/save/file', 'filename');