Laravel Nova动作-在Fields()上获取当前模型实例 [英] Laravel nova action - get current model instance on fields()

查看:58
本文介绍了Laravel Nova动作-在Fields()上获取当前模型实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Laravel 5.8新星2.0

在新星行动中

 公共功能字段(){返回 [];} 

这里有什么方法可以访问当前选定的行?

解决方案

Sometimes when I'm on the details view and want to perform an action on that record, but also want the current records data in the fields (maybe for help text), I grab it from the URL.

//Get the URL
    $explodeUrl = explode('/', strrev($_SERVER['HTTP_REFERER']), 2);

这篇关于Laravel Nova动作-在Fields()上获取当前模型实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆