whitecube / nova-page

Static pages content management for Laravel Nova
https://whitecube.github.io/nova-page
MIT License
238 stars 41 forks source link

Added Resource files to config #45

Closed GarethSomers closed 4 years ago

GarethSomers commented 4 years ago

Added Resource files to config to allow extending.

My use case

Controlling fields. Used in conjunction with this PR to set the custom sorting on Nova Page.

Closes

Usage

<?php

namespace App\Nova;

use Whitecube\NovaPage\Pages\PageResource;

class Page extends PageResource
{
    public static $model = \App\Models\Page::class;

    // Custom code
}

Edit I've found declaring a public static $model important as the Laravel\Nova\Rules\Relatable will try and use it when resolving a resource or something like that.

voidgraphics commented 4 years ago

You're on 🔥, thank you for your contributions!

GarethSomers commented 4 years ago

Doing the hard jobs today on my list haha