Search by

thesoftpulze / laravibe-standards

ashokbaruaakas

Standard conventions, structure, and tooling for Laravel apps built the LaraVibe way.

Package info

github.com/thesoftpulze/laravibe-standards

pkg:composer/thesoftpulze/laravibe-standards

Fund package maintenance!

thesoftpulze

Statistics

Installs: 187

Dependents: 2

Suggesters: 0

Stars: 1

Open Issues: 0

v0.7.2 2026-10-27 07:27 UTC

This package is auto-updated.

Last update: 2026-10-29 10:24:26 UTC


README

Laravibe Standards

Conventions, generators and base classes for Laravel apps built the LaraVibe way.

Packagist PHP Laravel Tests Downloads License

Made by The SoftPulze

Features

  • Actions: make:action generates single-purpose action classes in app/Actions, with an optional test.
  • DTOs: make:dto and the AsDTO trait for immutable, typed DTOs. See the DTO guide.
  • Enums: the HasEnumMetadata trait adds labels, options and validation helpers. See the enum guide.
  • Resources: AppResource and AppResourceCollection with field helpers for API and Inertia responses. See the resource guide.
  • Stubs for make:action, make:dto, make:enum and make:resource.
  • Laravel Boost guideline and skills for AI agents.

Installation

Requires PHP 8.4+ and Laravel 13+.

composer require thesoftpulze/laravibe-standards
php artisan vendor:publish --tag="laravibe-standards-stubs"

The stubs are published to the application's stubs directory. Without them, make:enum and make:resource generate plain Laravel classes.

Upgrading from softpulze/laravibe-standards? Require thesoftpulze/laravibe-standards instead and rename SoftPulze\LaravibeStandards imports to TheSoftPulze\LaravibeStandards.

Usage

Actions

php artisan make:action Account/UpdateProfileAction --pest
final readonly class UpdateProfileAction
{
    public function handle(User $user, UpdateProfileDTO $data): User
    {
        $user->update($data->toEloquent());

        return $user;
    }
}

Pass --test, --pest or --phpunit to also generate a test in tests/Feature/Actions.

DTOs

php artisan make:dto Account/UpdateProfileDTO
final readonly class UpdateProfileDTO implements Arrayable, Jsonable
{
    use \TheSoftPulze\LaravibeStandards\DTOs\Concerns\AsDTO;

    public function __construct(
        public string $name,
        public ?string $bio = null,
    ) {}
}

$dto = UpdateProfileDTO::from($request);
$dto->toArray();
$dto->toEloquent();
$dto->with(['bio' => 'Senior Dev']);

Enums

php artisan make:enum ToastType --string
enum ToastType: string
{
    use \TheSoftPulze\LaravibeStandards\Enums\Concerns\HasEnumMetadata;

    case Success = 'success';
    case Error = 'error';
}

ToastType::options();
ToastType::values();
ToastType::Success->label();

Resources

php artisan make:resource UserResource
final class UserResource extends \TheSoftPulze\LaravibeStandards\Resources\AppResource
{
    public function toArray(Request $request): array
    {
        return [
            $this->id(),
            $this->attribute('name'),
            ...$this->timestamps(),
        ];
    }
}

return inertia('users/Show', ['user' => UserResource::make($user)->toInertia()]);

AI Agents

php artisan boost:install

When prompted for third-party packages, select thesoftpulze/laravibe-standards to install the action, DTO, enum and resource guidelines. Run php artisan boost:update after updating the package.

Changelog

See CHANGELOG for recent changes.

Contributing

See the contributing guide and security policy.

Credits

Laravibe Standards is developed and maintained by The SoftPulze.

Built on Laravel.

License

Laravibe Standards is open-source software licensed under the MIT license. Copyright © 2025-present The SoftPulze.