PHPackages                             binafy/laravel-stub - 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. [Framework](/categories/framework)
4. /
5. binafy/laravel-stub

ActiveLibrary[Framework](/categories/framework)

binafy/laravel-stub
===================

Generate stub files easy

v1.1.0(1y ago)99158.8k↑14.7%8[2 PRs](https://github.com/binafy/laravel-stub/pulls)8MITPHPPHP ^8.0CI passing

Since Mar 29Pushed 1mo ago3 watchersCompare

[ Source](https://github.com/binafy/laravel-stub)[ Packagist](https://packagist.org/packages/binafy/laravel-stub)[ Docs](https://github.com/binafy/laravel-stub)[ RSS](/packages/binafy-laravel-stub/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelog (8)Dependencies (3)Versions (11)Used By (8)

Laravel Stub
------------

[](#laravel-stub)

[![laravel-stub-banner](https://camo.githubusercontent.com/74450c833dd56b35ad8f43f73fb536845cbd30c5b0662451f514cc0cc512d29a/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c61726176656c253230537475622e706e673f7468656d653d6461726b267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d62696e6166792532466c61726176656c2d73747562267061747465726e3d797979267374796c653d7374796c655f31266465736372697074696f6e3d47656e65726174652b737475622b66696c65732b766572792b656173792b696e2b4c61726176656c2b6672616d65776f726b266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667)](https://camo.githubusercontent.com/74450c833dd56b35ad8f43f73fb536845cbd30c5b0662451f514cc0cc512d29a/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c61726176656c253230537475622e706e673f7468656d653d6461726b267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d62696e6166792532466c61726176656c2d73747562267061747465726e3d797979267374796c653d7374796c655f31266465736372697074696f6e3d47656e65726174652b737475622b66696c65732b766572792b656173792b696e2b4c61726176656c2b6672616d65776f726b266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667)

[![PHP Version Require](https://camo.githubusercontent.com/ff421714de983b9db9ff4b72018806f02a72f6fb7be700ec67c042c581e2ce34/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f62696e6166792f6c61726176656c2d737475622f7068702e737667)](https://packagist.org/packages/binafy/laravel-stub)[![Latest Stable Version](https://camo.githubusercontent.com/521081d93a4af328a8c94d69da3c1f049758c144311977df3a31a82ede3187ac/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62696e6166792f6c61726176656c2d737475622e737667)](https://packagist.org/packages/binafy/laravel-stub)[![Total Downloads](https://camo.githubusercontent.com/eca21c70398b41413c74fa0200c37c971b77698564cb8dfb6b2f91a8ff5d094e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f62696e6166792f6c61726176656c2d737475622e737667)](https://packagist.org/packages/binafy/laravel-stub)[![License](https://camo.githubusercontent.com/5f66343d49d88564c21fab19e4fba813024038154df88b4fa3898b1c77d97ccf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f62696e6166792f6c61726176656c2d737475622e737667)](https://packagist.org/packages/binafy/laravel-stub)[![Passed Tests](https://github.com/binafy/laravel-stub/actions/workflows/tests.yml/badge.svg)](https://github.com/binafy/laravel-stub/actions/workflows/tests.yml)

- [Introduction](#introduction)
- [Requirements](#requirements)
- [Installation](#installation)
- [Usage](#usage)
    - [Create a stub file](#create-a-stub-file)
    - [How to use Laravel Stub](#how-using-laravel-stub)
    - [`from`](#from)
    - [`to`](#to)
    - [`name`](#name)
    - [`ext`](#ext)
    - [`replace`](#replace)
    - [`replaces`](#replaces)
    - [`moveStub`](#move-stub)
    - [`conditions`](#conditions)
    - [`download`](#download)
    - [`generate`](#generate)
    - [`generateForce`](#generate-force)
    - [`generateIf`](#generate-if)
    - [`generateUnless`](#generate-unless)
- [Contributors](#contributors)
- [Security](#security)
- [Changelog](#changelog)
- [License](#license)
- [Donate](#donate)

Introduction
------------

[](#introduction)

The Laravel-Stub package enhances the development workflow in Laravel by providing a set of customizable stubs. Stubs are templates used to scaffold code snippets for various components like models, controllers, and migrations. With Laravel-Stub, developers can easily tailor these stubs to match their project's coding standards and conventions. This package aims to streamline the code generation process, fostering consistency and efficiency in Laravel projects. Explore the customization options and boost your development speed with Laravel-Stub.

Requirements
------------

[](#requirements)

---

- `PHP >= 8.0`
- `Laravel >= 9.0`

Version/LaravelL9L10L111.0✅✅✅

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

[](#installation)

You can install the package with Composer:

```
composer require binafy/laravel-stub
```

You don't need to publish anything.

Usage
-----

[](#usage)

### Create a stub file

[](#create-a-stub-file)

First of all, create a stub file called `model.stub`:

```
touch model.stub
```

Add some code to that, like this:

```
