Comments (8)
I've been thinking about changing the position of the add button as well as it can get confusing when at the bottom. Your idea could work and wouldn't be very hard to change. However, in terms of coloring the button, I still believe it is better to have the darker primary color to not confuse it with the actual current resource actions... I'll see what works best :)
from laravel-nova-nested-form.
That makes sense. Darker background is good. I don't think having the same size buttons is confusing as long as it's far away from the create buttons. I just thought a small one was hard to click haha.
I do think that "No memberships" text is important to be clear that you do not currently have a resource added though.
Thanks for all your work on this. It's a lifesaver :)
from laravel-nova-nested-form.
A good idea would be to have some sort of border/separator at the END of each entity ?
from laravel-nova-nested-form.
Hey, please try out the updated version on the "next" branch, there are a number of improvements including this one ;) Please note that you will need to remove the NestedFormTrait from your App\Nova\Resource, which is no longer needed!
from laravel-nova-nested-form.
@yassipad I get the error "Object of class Closure could not be converted to string". I removed the Trait.
from laravel-nova-nested-form.
Can you give me some more details?
from laravel-nova-nested-form.
When I open the resource I get this. If I switch to the master branch (and put back the trait) then everything works again. I've tried clearing the laravel cache and in a incognito browser.
<?php
namespace App\Nova;
use Laravel\Nova\Fields\Avatar;
use Laravel\Nova\Fields\HasMany;
use Illuminate\Http\Request;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Http\Requests\NovaRequest;
use Yassi\NestedForm\NestedForm;
class Member extends Resource
{
/**
* The model the resource corresponds to.
*
* @var string
*/
public static $model = 'App\Member';
/**
* The single value that should be used to represent the resource when being displayed.
*
* @var string
*/
public static $title = 'name';
/**
* The columns that should be searched.
*
* @var array
*/
public static $search = [
'name',
];
/**
* Get the fields displayed by the resource.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function fields(Request $request)
{
return [
Avatar::make('Photo')
->hideWhenCreating()
->disk('tenant'),
Text::make('Name')
->rules('required'),
Text::make('Email')
->sortable()
->rules('required', 'email', 'max:254')
->creationRules('unique:tenant.members,email')
->updateRules('unique:tenant.members,email,{{resourceId}}'),
HasMany::make('Memberships'),
NestedForm::make('Memberships'),
];
}
/**
* Get the cards available for the request.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function cards(Request $request)
{
return [];
}
/**
* Get the filters available for the resource.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function filters(Request $request)
{
return [];
}
/**
* Get the lenses available for the resource.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function lenses(Request $request)
{
return [];
}
/**
* Get the actions available for the resource.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function actions(Request $request)
{
return [];
}
}
from laravel-nova-nested-form.
@yassipad I tried this again and now it is working (no idea what the issue was). Do you think the left padding should be the same as the label of a field and right padding the same as the bottom buttons like the screenshot above? I personally feel like they are squashed right now.
Thanks so much for this change!
from laravel-nova-nested-form.
Related Issues (20)
- Global search is broken, when using NestedForm HOT 4
- Changing text when there is no data HOT 2
- Multiple subresources are created when Observer saves main resource again HOT 2
- How to pass a parameter to child nested form? HOT 7
- Help text is not displayed HOT 6
- The nested relationship model is often not yet available in the parent object observer created() method
- What's the best way to translate things in LNNF HOT 2
- Second nested form display index incorrect
- Nested form validation not working. HOT 1
- Nested Form not working after update laravel 7 and nova 3
- defining the inverse - Whats's wrong? HOT 2
- Touch related items
- Is there anyway to override file field
- Support for Laravel Nova Advanced media library HOT 2
- Slow result rendring while using with BelongsTo field
- Support for Laravel Nova 4 HOT 15
- How to hide relationship column
- Question: is it possible to show related resources not only when editing, but when viewing main resource too?
- Trying to get property 'resourceClass' of non-object
- The Add new Record button is not adding the correct index
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-nova-nested-form.