Maintainers

Package info

github.com/goszowski/stub

pkg:composer/goszowski/stub

Statistics

Installs: 15

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2017-04-27 12:30 UTC

This package is auto-updated.

Last update: 2026-03-08 11:01:48 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');