Closed wimurk closed 5 years ago
Hello, I am not sure what you mean exactly. That screenshot does not have any cards in it, it has Panels, which are defined exactly how you mentioned.
Here's an example of a nova-page template with a Panel:
namespace App\Nova\Templates;
use Illuminate\Http\Request;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Panel;
use Whitecube\NovaPage\Pages\Template;
class About extends Template
{
/**
* Get the fields displayed by the resource.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function fields(Request $request)
{
return [
new Panel('Pagina informatie', $this->somePageFields()),
];
}
protected function somePageFields()
{
return [
Text::make('Title'), // ...
]
}
/**
* Get the cards available for the request.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function cards(Request $request)
{
return [];
}
}
@voidgraphics Yes i meant panels. I am kinda new to nova and its components. The panels are only showed when viewing the page in detail and not when editing one. Would be nice if there were panels to when editing a page.
Indeed it would be nice. This is an issue with Laravel Nova though: https://github.com/laravel/nova-issues/issues/29
The good news is that the issue @voidgraphics mentioned has the planned
tag applied to it.
@wimurk in the meantime you could use the official Heading field in order to add a little bit more structure to the edit pages. Hope this helps!
Yes that helps. The heading field isn't released yet so i will have to wait till laravel/nova-issues#29 is releases
In the docs you mentioned that the fields and cards definition is exactly the same as regular Laravel Nova Resources. In the laravel navo resource can add cards to the edit page. Like the image below
I can't figure out how this works with this package. Can you provide a code sample or edit the docs?