1.0.0 2017-04-27 12:30 UTC

This package is auto-updated.

Last update: 2024-12-08 08:32:21 UTC


README

Total Downloads Latest Stable Version License

stub

Generate file from stub

Installation

	composer require goszowski\stub

Usage

<?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');

Usage in Laravel

<?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');