A simple way to generate files from stubs.

Related tags

Laravel stubby
Overview

STUBBY

A simple way to generate files from stubs.


Usage

For example we have a stub file that looks like this:

<?php

namespace {{ namespace }};

use App\Magic;

class {{ class }} extends Magic
{
    // Write down the magic here
}

Via CLI

php stubby generate magic.stub FooBar.php

The commnd-line will ask you to give a value for every token found in the stub file.

 Provide a value for {{ namespace }}:
 > App

 Provide a value for {{ class }}:
 > FooBar

Successfully generated Foobar.php

Via Stubby class

$values = ["namespace" => "App", "class" => "FooBar"];

Stubby::stub("magic.stub")->generate("FooBar.php", $values);

Expected Output

<?php

namespace App;

use App\Magic;

class FooBar extends Magic
{
    // Write down the magic here
}

Roadmap

  • Proof of Concept
  • Add tests
  • Publish as a composer package
  • Make documentation
You might also like...
A simple package that helps PHP developers to generate the QR code signature as per Zakat authority (ZATCA) requirements of Saudi Arabia.

A PHP package that implements the e-invoice QR code signature requirements as designed by the Zakat authority of Saudi Arabia. How to install? compose

A simple way to add 301/302 redirects within CraftCMS.
A simple way to add 301/302 redirects within CraftCMS.

Redirector plugin for Craft CMS 3.x A simple way to add 301/302 redirects within CraftCMS. This is the first CraftCMS plugin written by myself so plea

 Laravel Logable is a simple way to log http request in your Laravel application.
Laravel Logable is a simple way to log http request in your Laravel application.

Laravel Logable is a simple way to log http request in your Laravel application. Requirements php = 7.4 Laravel version = 6.0 Installation composer

Kalibrant - a package that provides a simple way to manage your models settings
Kalibrant - a package that provides a simple way to manage your models settings

Introduction For your laravel 9.x applications, Kalibrant is a package that provides a simple way to manage your models settings. It is a simple way t

This package aims to help you standardize all your API responses in a simple and structured way.

Laravel API Response This package aims to help you standardize all your API responses in a simple and structured way. By default, the stucture of the

This package provides a Logs page that allows you to view your Laravel log files in a simple UI
This package provides a Logs page that allows you to view your Laravel log files in a simple UI

A simplistics log viewer for your Filament apps. This package provides a Logs page that allows you to view your Laravel log files in a simple UI. Inst

Laravel package to generate and to validate a UUID according to the RFC 4122 standard. Only support for version 1, 3, 4 and 5 UUID are built-in.

Laravel Uuid Laravel package to generate and to validate a universally unique identifier (UUID) according to the RFC 4122 standard. Support for versio

Generate and autoload custom Helpers, Builder Scope, Service class, Trait

laravel-make-extender Generate and autoload custom helpers, It can generate multilevel helpers in the context of the directory. Generate Service class

A package to generate modules for a Laravel project.

Laravel Modular A package to generate modules for a Laravel project. Requirements PHP 7.4 or greater Laravel version 8 Installation Install using comp

Releases(1.1.2)
Owner
Prince John Santillan
I am a Laravel pilgrim.
Prince John Santillan
Laravel File Generators with config and publishable stubs

Laravel File Generators Custom Laravel File Generators with a config file and publishable stubs. You can publish the stubs. You can add your own stubs

Ben-Piet O'Callaghan 116 Oct 29, 2022
A laravel package to generate class files from stub files.

Laravel Stub Generator A php laravel package to generate useable php files from given stub files . Installation Require the package using composer: co

Touhidur Rahman 31 Dec 29, 2022
Otpify is a Laravel package that provides a simple and elegant way to generate and validate one time passwords.

Laravel Otpify ?? Introduction Otpify is a Laravel package that provides a simple and elegant way to generate and validate one time passwords. Install

Prasanth Jayakumar 2 Sep 2, 2022
Boilerplate code for protecting a form with proof of work. Uses javascript in the browser to generate the hashcash and PHP on the server to generate the puzzle and validate the proof of work.

Boilerplate code for protecting a form with proof of work. Uses javascript in the browser to generate the hashcash and PHP on the server to generate the puzzle and validate the proof of work.

Jameson Lopp 28 Dec 19, 2022
Generate trends for your models. Easily generate charts or reports.

Laravel Trend Generate trends for your models. Easily generate charts or reports. Support us Like our work? You can support us by purchasing one of ou

Flowframe 139 Dec 27, 2022
Generate form validators for Laravel: an extension of way/generators

Laravel Form Validator Contents Introduction Installation Usage Example Tests Introduction After using Jeffrey Way's Generator and his Validator packa

John Evans 6 Jan 14, 2022
🏭 An easy way to generate populated factories for models.

Laravel Populated Factory provides an easy way to generate populated factories for models according to types & names of their columns. Install You can

Coderello 241 Nov 25, 2022
Laravel Package to generate CRUD Files using TALL Stack

tall-crud-generator Laravel Package to generate CRUD Files using TALL Stack Requirements Make sure that Livewire is installed properly on your project

AscSoftwares 75 Jan 2, 2023
Easy way to upload Laravel model related files from the request.

Easy way to upload laravel model related file from the requset.

Emon Khan 5 Dec 15, 2022
A Laravel package that allows you to use multiple ".env" files in a precedent manner. Use ".env" files per domain (multi-tentant)!

Laravel Multi ENVs Use multiple .envs files and have a chain of precedence for the environment variables in these different .envs files. Use the .env

Allyson Silva 48 Dec 29, 2022