PHPackages                             bakgul/laravel-file-creator - 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. [CLI &amp; Console](/categories/cli)
4. /
5. bakgul/laravel-file-creator

ActiveLibrary[CLI &amp; Console](/categories/cli)

bakgul/laravel-file-creator
===========================

This package aims to create the app, database, and test files. It can be a replacement for Laravel's file generator because this package offers some quite nice features. It offers extra file types like interface, trait, service, etc. Depending on the settings, it can create dozens of files with a single command and connect them to each other properly.

v4.0.4(3y ago)21254MITPHPPHP ^8.1

Since May 17Pushed 3y ago1 watchersCompare

[ Source](https://github.com/bulentAkgul/laravel-file-creator)[ Packagist](https://packagist.org/packages/bakgul/laravel-file-creator)[ RSS](/packages/bakgul-laravel-file-creator/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (5)Versions (31)Used By (4)

Laravel File Creator
====================

[](#laravel-file-creator)

This package aims to create the app, database, and test files. It can be a replacement for Laravel's file generator because this package offers some quite nice features. It offers extra file types like interface, trait, service, etc. Depending on the settings, it can create dozens of files with a single command and connect them to each other properly.

### Update to v4

[](#update-to-v4)

#### Config

[](#config)

If you didn't make any changes on `config/packagify.php`, simply delete it and republish the settings. Otherwise, go to `vendor/bakgul/laravel-file-creator/config/methods.php`, get the array and insert it to `packagify.php` associated with the key named `methods`.

#### Stubs

[](#stubs)

Controller uses a single stub file, and it generate everything on the fly. If you have custom controller stubs for different variations, you can't use them in this version unless you modify `controller.stub` and make it work for you.

Service stub is also updated.

### What is new?

[](#what-is-new)

- Task base invokable controller has become possible.
- Controller's methods' arguments, body, and return have become quite detailed and hopefully handy.
- Services contains basic implementations of their tasks and proper return types.

### Installation

[](#installation)

If you installed [**Packagified Laravel**](https://github.com/bulentAkgul/packagified-laravel), you should have this package already. So skip installation.

```
composer require bakgul/laravel-file-creator

```

Next, you need to publish the settings by executing the following command. By doing so, you will have a new file named *packagify.php* on the config folder. If you check the "**files**" array, you can see the file types that can be created. Quite deep explanations are provided in the comment block of the files array.

```
sail artisan packagify:publish-config

```

After publishing stubs, you will be able to update the stub files as you need. It's safe to delete the unedited files.

```
sail artisan packagify:publish-stub

```

### Command Signature

[](#command-signature)

```
create:file {name} {type} {package?} {app?} {--p|parent=} {--t|taskless} {--f|force}

```

### Arguments

[](#arguments)

- **name**: subs/name:task

    - **subs**: You can specify subfolders like **sub1/sub2/sub3** when you need a deeper file structure than the file types path\_schema provides.
    - **name**: The file name without any suffix.
    - **task**: This is optional.

        - *exist*: You may set one or more tasks with a dot-separated fashion like "**users:index**" or "**users:index.store.update**." The task should be in the file type and its pairs' and the global task lists (see the tasks array on *config/packagify.php*). Otherwise, it will be ignored.
        - *missing*: If the underlying file type has tasks, a separate file will be generated for each of them. Otherwise, a single file will be generated.
- **Type**: name:variation:mod

    - **name**: It's required and should be one of the keys in the **files** array on *config/packagify.php* except for the **view, css, js, livewire, and component**. These keys will be used by [**Laravel Resource Creator**](https://github.com/bulentAkgul/laravel-resource-creator). All detailed explanations can be found in the comment block of the **files** array.
    - **variation**: It's optional.

        - *exist*: If the given file type has variations, you may specify which one should be created.
        - *missing*: The default variation, which is the first item in the variations array, will be used.
    - **mod**: When a veriation has different mods, you can speciy it here. For example, controller's variations have default and "api" modes. To create an api controller, you should use `controller::api` and to create a nested api, you should use `controller:nested:api`.
    - `
- **Package**: It won't be used when working on a Standalone Laravel or Standalone Package. If you don't specify a valid package name, the file will be generated in the App namespace.
- **App**: Some files, like the controller, may have app-specific. When I say app, I mean admin, web, desktop, etc. To create those files in the dedicated app folder, you must specify the app name. The settings are in the **apps** array on the *config/packagify.php* file.

### Options

[](#options)

- **Parent**: To create a nested controller, a parent model, or to create a listener, a parent event is required. Evaluator will warn you when a parent has to be specified.
- **Taskless**: The file types that have tasks like service, or test, will be generated as a separate file for each task unless tasks are specified. But sometimes, you may want to create a single file without any task. In such cases, You need to append "**-t**" or "**--taskless**" to your command. This will cancel the default behaviour of the task explosion.
- **Force**: Normally, a file will not be regenerated if it exists. If this option is passed, a new file will be created anyway.

Packagified Laravel
-------------------

[](#packagified-laravel)

The main package that includes this one can be found here: [**Packagified Laravel**](https://github.com/bulentAkgul/packagified-laravel)

The Packages That Will Be Installed By This Package
---------------------------------------------------

[](#the-packages-that-will-be-installed-by-this-package)

- [**Command Evaluator**](https://github.com/bulentAkgul/command-evaluator)
- [**File Content**](https://github.com/bulentAkgul/file-content)
- [**File History**](https://github.com/bulentAkgul/file-history)
- [**Kernel**](https://github.com/bulentAkgul/kernel)

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity68

Established project with proven stability

 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

Every ~9 days

Recently: every ~0 days

Total

30

Last Release

1227d ago

Major Versions

v1.1.16 → v2.0.02023-01-02

v2.1.0 → v3.0.02023-01-25

v3.0.3 → v4.0.02023-02-21

PHP version history (2 changes)v1.1.1PHP ^8.0.2

v4.0.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/dc3c26b9029d2705ffcd2baebee543db52c24b1fb5cb29c5557436de853d42c1?d=identicon)[bulentAkgul](/maintainers/bulentAkgul)

---

Top Contributors

[![bulentAkgul](https://avatars.githubusercontent.com/u/12589023?v=4)](https://github.com/bulentAkgul "bulentAkgul (214 commits)")

### Embed Badge

![Health badge](/badges/bakgul-laravel-file-creator/health.svg)

```
[![Health](https://phpackages.com/badges/bakgul-laravel-file-creator/health.svg)](https://phpackages.com/packages/bakgul-laravel-file-creator)
```

###  Alternatives

[illuminate/console

The Illuminate Console package.

13046.0M6.5k](/packages/illuminate-console)[winbox/args

Windows command-line formatter

20720.9k21](/packages/winbox-args)

PHPackages © 2026

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