laravel-nova

Laravel Nova: Group form fields in columns

非 Y 不嫁゛ 提交于 2021-02-19 05:30:51
问题 How can i create columns on my form fields in Laravel Nova? For instance, i'm trying to separate the first- and lastname but don't wanna have it on two lines. I would prefere to have it next to each other, but i don't find any possibility to choose that option. Does anyone have an idea how to solve it? Or has a package that does it? I already searched but nothing found. Thanks 回答1: This is currently not possible with Laravel Nova. 回答2: This can be acheaved with this package: https://github

Laravel Nova: Bypass the search with Scout

人盡茶涼 提交于 2021-01-29 02:40:31
问题 How to disable searching for a resource with Scout without removing the Searchable trait from the resource model? I want to deliberately bypass the Scout search inside Nova. 回答1: Add this to your Nova Resource public static function usesScout() { return false; } 来源: https://stackoverflow.com/questions/53061448/laravel-nova-bypass-the-search-with-scout

Laravel nova diffForHumans DateTime

ⅰ亾dé卋堺 提交于 2021-01-28 18:32:44
问题 I have field last_active on users, I want display time with diffForHumans or time_from_now from Moment.js. How I can do it? Now I just use: DateTime::make('Activiy', 'last_active') ->exceptOnForms(), When I use: DateTime::make('Activiy', 'last_active')->diffForHumans() ->exceptOnForms(), I get undifined method diffForHumans . 回答1: To my knowledge at the moment DateTime only supports format . Since you want only to display, you can try Text field & display the humanise value. Text::make(

laravel nova hide edit button on index page

橙三吉。 提交于 2021-01-05 09:57:12
问题 How to disable edit/delete button on nova index page and still allow in detail page, if I will create a policy, that will disable the operation everywhere, I want to allow edit and delete in detail page, but just want to remove those button from index, is doing something like public function update(User $user, Customer $customer) { if ( request()->route()->getName('route-name') ) { return false; } } is correct way or there is any better way? 回答1: I had a resource of Leads and I needed to hide