Laravel-admin: 自定义form视图,如何知道当前在创建还是编辑数据?

Created on 6 Feb 2018  ·  2Comments  ·  Source: z-song/laravel-admin

  • Laravel Version: 5.3.*
  • PHP Version:7
  • Laravel-admin: 1.3.*

在form方法中使用了 $form->html(view('admin.gift.form'),'xxx);自定义视图,想在视图里判断当前是创建的操作(没有id)还是编辑的操作(有id)来进行不同的逻辑,但暂时没找到相关方法?求教~

wontfix

Most helpful comment

if (request()->route()->getActionMethod() == 'edit') {
}

All 2 comments

if (request()->route()->getActionMethod() == 'edit') {
}

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

amun1303 picture amun1303  ·  3Comments

evans-kim picture evans-kim  ·  3Comments

donglianyou picture donglianyou  ·  3Comments

vlongen picture vlongen  ·  3Comments

benny-sun picture benny-sun  ·  3Comments