PHPackages                             vagento/file-generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. vagento/file-generator

ActiveVagento-module[Utility &amp; Helpers](/categories/utility)

vagento/file-generator
======================

0.0.1(4y ago)15MITPHPPHP ^8.0

Since Dec 11Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Vagento/File-Generator)[ Packagist](https://packagist.org/packages/vagento/file-generator)[ RSS](/packages/vagento-file-generator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Vagento - File Generator
========================

[](#vagento---file-generator)

 [![Version](https://camo.githubusercontent.com/a475c0e16a17087590975a118b3828ec74c6bba504e819e864f4873f1b808978/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e312d626c75652e7376673f63616368655365636f6e64733d32353932303030)](https://camo.githubusercontent.com/a475c0e16a17087590975a118b3828ec74c6bba504e819e864f4873f1b808978/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e312d626c75652e7376673f63616368655365636f6e64733d32353932303030) [ ![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667) ](https://opensource.org/licenses/MIT) [ ![Twitter: WWoshid](https://camo.githubusercontent.com/cfd4313c9152ad5116dd64ce61b68ba7b0e27e9c56cbc7e8a9cd258f336e5db7/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f57576f736869642e7376673f7374796c653d736f6369616c) ](https://twitter.com/WWoshid)

> This package adds file generators. It requires the Laravel framework.

Installation
------------

[](#installation)

```
composer require vagento/file-generator
```

Usage
-----

[](#usage)

**Stub File Generator - From class**1. Create a new **class** which extends the `\Vagento\FileGenerator\AbstractStubFileGenerator` class.
    And add the **getter methods** to the class:

```
use Vagento\FileGenerator\AbstractStubFileGenerator;

class MyFileGenerator extends AbstractStubFileGenerator
{
    // Required: This is the path to the file that will be generated
    public function getPath(): string
    {
        return 'path/to/fileToGenerate.php';
    }

    // Required: This is the path to the stub file
    public function getStubPath(): string
    {
        return __DIR__ . '/stubs/file.blade.php';
    }

    // Optional: This is the data that will always be passed to the stub file
    public function getStubData(): array
    {
        // [Key (string) => Value (mixed)]
        return ['always' => 5];
    }
}
```

2. Create a new **stub file**, which must end with `.blade.php`.
    You can use the **blade syntax**:

```
Filename: file.blade.php
Always: {{ $always }}

```

3. Create a new **instance of the class** and call the `generate()` method.
    You can also chain the methods.

```
$generator = new MyFileGenerator();

// Generate the file
$generator->generate();
```

Which will result in the following file:

```
Filename: file.blade.php
Always: 5

```

The `generate()` method will generate the file and overwrite any existing file.

**Stub File Generator - From setters**1. Create a new **stub file**, which must end with `.blade.php`.
    You can use the **blade syntax**:

```
Filename: file.blade.php
Data to add: {{ $dataToAdd }}

```

2. Create a new **instance of the class** and call the `generate()` method.
    You can use the **constructor** or use the **methods** (or **chain** them).

```
$generator = new \Vagento\FileGenerator\Generators\StubFileGenerator(
    'path/to/fileToGenerate.php', // Path to the file which will be generated
    __DIR__ . '/stubs/file.blade.php', // Path to the stub file
    ['dataToAdd' => 10] // Optional: Data that will be passed to the stub file
);

// Generate the file
$generator->generate();

// OR

$generator = new \Vagento\FileGenerator\Generators\StubFileGenerator();

// Set the path to the file which will be generated
$generator->setPath('path/to/fileToGenerate.php');

// Set the path to the stub file
$generator->setStubPath(__DIR__ . '/stubs/file.blade.php');

// Optional: Add data to the stub file
$generator->addStubData(['dataToAdd', 10]);

// Generate the file
$generator->generate();

// OR

// Chain methods
$generator->setPath('path/to/fileToGenerate.php')
    ->setStubPath(__DIR__ . '/stubs/file.blade.php')
    ->addStubData(['dataToAdd', 10])
    ->generate();
```

Which will result in the following file:

```
Filename: file.blade.php
Data to add: 10

```

The `generate()` method will generate the file and overwrite any existing file.

Show your support
-----------------

[](#show-your-support)

Give a ⭐️ if this project helped you!

📝 License
---------

[](#-license)

Copyright © 2021 [Valentin Wotschel](https://github.com/WalterWoshid).
This project is [MIT](https://opensource.org/licenses/MIT) licensed.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1616d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/37f7c13a71918329aa63e5e3a28b121d26442ce1668a731bb00005dd972d134a?d=identicon)[WalterWoshid](/maintainers/WalterWoshid)

---

Top Contributors

[![WalterWoshid](https://avatars.githubusercontent.com/u/36635504?v=4)](https://github.com/WalterWoshid "WalterWoshid (2 commits)")

### Embed Badge

![Health badge](/badges/vagento-file-generator/health.svg)

```
[![Health](https://phpackages.com/badges/vagento-file-generator/health.svg)](https://phpackages.com/packages/vagento-file-generator)
```

###  Alternatives

[wireui/wireui

TallStack components

1.8k1.3M16](/packages/wireui-wireui)[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4195.3M84](/packages/livewire-volt)[ramonrietdijk/livewire-tables

Dynamic tables for models with Laravel Livewire

21147.4k](/packages/ramonrietdijk-livewire-tables)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
