PHP code example of think.studio / nova-forms-entries

1. Go to this page and download the library: Download think.studio/nova-forms-entries library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

think.studio / nova-forms-entries example snippets


use App\Nova\Resource;
use App\Nova\Resources\Staff;
use App\Nova\Resources\Contact;
use NovaFormEntries\FormEntryResource;

class FormEntry extends Resource
{
    use FormEntryResource;

    /**
     * The model the resource corresponds to.
     */
    public static $model = \FormEntries\Models\FormEntry::class;

    /**
     * The single value that should be used to represent the resource when being displayed.
     */
    public static $title = 'name';

    /**
     * The columns that should be searched.
     *
     * @var array
     */
    public static $search = [
        'created_at',
        'type',
        'id',
    ];

    public function senderTypes(): array
    {
        return [
            Contact::class,
            Staff::class,
        ];
    }
}