mateusztumatek/nova-model-link-field 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

mateusztumatek/nova-model-link-field

最新稳定版本:1.0.1

Composer 安装命令:

composer require mateusztumatek/nova-model-link-field

包简介

A Laravel Nova field.

README 文档

README

Search models and append links to this models by nova field

This field allow to fill database "link" column with link to Application Model

Scenario You have 4 models Product, Category, Blog, Order and also you have model Post with fields "name", 'link' .... You want have post with attached link to Product or Category etc.. In normal way, you have to create product_id or category_id ... But you only need link. Thats why this field comes in. You can attach link to multiple models with search functionality

INSTALLATION

composer require mateusztumatek/nova-model-link-field 

Basic usage

Add NovaIsLinkableContract to your models that should be linkable Example :

class Product extends Model implements NovaIsLinkableContract{

    /**
    * Generate link for nova link field 
    * @return string
    */
    public function novaLink(): string
    {
        return route('products.show', ['product' => $this->id]);
    }
}

And in your resource file

    public function fields(NovaRequest $request)
        {
            return [                                          
                NovaModelLinkField::make('Link', 'link')
            ];
        }

If you want keep relative path to your application url you can use

NovaModelLinkField::make('Link', 'link')->storeType('relative')

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-07-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固