PHPackages                             owenmelbz/laravel-stubs - 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. owenmelbz/laravel-stubs

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

owenmelbz/laravel-stubs
=======================

Easily store stubs for your project to reuse whenever needed.

0.0.7(5y ago)692.1k↓90%11MITPHPCI failing

Since Aug 26Pushed 5y ago1 watchersCompare

[ Source](https://github.com/OwenMelbz/Laravel-Stubs)[ Packagist](https://packagist.org/packages/owenmelbz/laravel-stubs)[ RSS](/packages/owenmelbz-laravel-stubs/feed)WikiDiscussions master Synced 3w ago

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

Laravel Stub Helper
===================

[](#laravel-stub-helper)

We often find outselves having to repeat the same boilerplating when creating new files such as javascript components, blade templates etc.

This package aims to help save your brain cells for the more important things in life (like pizza) by enabling you scaffold the things you're always repeating within a project by taking influence from the other `make:` commands.

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

[](#installation)

1- Install via composer `composer require owenmelbz/laravel-stubs`.

2- The package should use laravels new auto discovery, if not however you can manually register the service provider - typically done inside the `app.php` providers array e.g `OwenMelbz\LaravelStubs\StubsServiceProvider::class`.

3- If you're going to be modifying the default stubs, or adding your own stubs, you'll need to publish the config using `php artisan vendor:publish --tag=stubs-config` which will generate `config/template_stubs.php`

Usage
-----

[](#usage)

Run `php artisan make:a {stub} {name}` this will generate you a new file, based off the defined stub

The `{name}` will become the filename and typically the class/component name where the default `@placeholder` marker is used within the files.

Default stubs
-------------

[](#default-stubs)

You can view a full list of the default stubs from the config file -&gt; [https://github.com/OwenMelbz/Laravel-Stubs/blob/master/src/config/template\_stubs.php](https://github.com/OwenMelbz/Laravel-Stubs/blob/master/src/config/template_stubs.php)

Modifying existing stubs
------------------------

[](#modifying-existing-stubs)

If you want to modify a default stub you can do this in 2 different ways.

The stubs are loaded in a waterfall style - so if you have your own file inside your `resources/stubs` folder we will use this file instead.

You can either use the same filename that is defined within the `stub` key of the config e.g `vue-component.js` and we'll use that. Or you can create a file of any name and change the `stub` key in a published config file.

If you want to modify every stub in the package, you can publish all the stubs in 1 go using `php artisan vendor:publish --tag=stubs-stubs` which will place them all in your `resources/stubs` folder.

Adding custom stubs
-------------------

[](#adding-custom-stubs)

You can either publish the default config and modify it, or create your own called `template_stubs.php` - if you wanted you could even use `php artisan make:a config template_stubs` and start adding your own.

Creating a new stub requires at minimum, a stub file, an output path, and a name. Below is an example structure

```
'my-stub' => [
    'stub' => 'my-stub.php',
    'output_path' => resource_path('some-folder')
]
```

It's worth noting that the file extension of the outputted file will match that of the stub file. So in this instance we do not recommend using `.stub` as your file extension.

During the generation process we parse a token called `@placeholder` anywhere this marker is within your stub, will get replaced by the name you passed into the command. e.g

This command `artisan make:a vue my-component` will see a file

```
Vue.component('@placeholder', {

});
```

and generate `my-component.js` with the content

```
Vue.component('my-component', {

});
```

If you want to change `@placeholder` to something else add the `placeholder => '@myothername'` to the stub definition within the config.

Contributing community stubs
----------------------------

[](#contributing-community-stubs)

Please feel free to submit pull requests to add custom stubs, make sure there are no naming conflicts, and keep them as simple as possible.

Typically we adhear to a PSR-2 style for php files, I may modify the code style to make it consistent with submitted stubs.

Notes
-----

[](#notes)

This is a very new package, has not been heavily used in the wild, so please bare with me if you stumble across bugs, always add a PR where possible to fix issues as its massively appreciated.

Thank :D

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.1% 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

Every ~220 days

Recently: every ~329 days

Total

7

Last Release

1905d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1094740?v=4)[Owen Melbourne](/maintainers/OwenMelbz)[@OwenMelbz](https://github.com/OwenMelbz)

---

Top Contributors

[![OwenMelbz](https://avatars.githubusercontent.com/u/1094740?v=4)](https://github.com/OwenMelbz "OwenMelbz (16 commits)")[![Hardpunk](https://avatars.githubusercontent.com/u/7231062?v=4)](https://github.com/Hardpunk "Hardpunk (1 commits)")

---

Tags

laravelstubstemplates

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/owenmelbz-laravel-stubs/health.svg)

```
[![Health](https://phpackages.com/badges/owenmelbz-laravel-stubs/health.svg)](https://phpackages.com/packages/owenmelbz-laravel-stubs)
```

###  Alternatives

[bpocallaghan/generators

Custom Laravel File Generators with config and publishable stubs.

12167.1k3](/packages/bpocallaghan-generators)

PHPackages © 2026

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