承接 novius/laravel-filament-slug 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

novius/laravel-filament-slug

Composer 安装命令:

composer require novius/laravel-filament-slug

包简介

A Laravel Filament Forms slug field.

README 文档

README

Laravel Filament Slug

Novius CI Packagist Release License: AGPL v3

Introduction

This package add a Slug field to Filament Forms

Requirements

  • PHP >= 8.2
  • Laravel >= 11.0
  • Laravel Filament >= 4

Installation

composer require novius/laravel-filament-slug

Usage

class YourResource extends Resource
{
    public static function form(Form $form): Form
    {
        return $form
            ->schema([
                $title = TextInput::make('title')
                    ->required(),
    
                Slug::make('slug')
                    // First parameter of fromField() must be the TextInput instance from which the slug is generated.
                    // Second parameter is optional. If passed, must be a closure returning if the slug generation should be skip or not.
                    ->fromField($title, fn (Get $get) => ! $get('other_value'))
                    // Slug inherit from TextInput. You can use all other method of TextInput. 
                    ->required()
                    ->string()
                    ->regex('/^(\/|[a-zA-Z0-9-_]+)$/')
                    ->unique(
                        YourModel::class,
                        'slug',
                        ignoreRecord: true
                    ),
            ]);
    }
}

Lint

Run php-cs with:

composer run-script lint

Contributing

Contributions are welcome!

Leave an issue on GitHub, or create a Pull Request.

Licence

This package is under GNU Affero General Public License v3 or (at your option) any later version.

统计信息

  • 总下载量: 2.06k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: AGPL-3.0-or-later
  • 更新时间: 2026-02-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固