PHP code example of marko298 / nova-single-record-resource
1. Go to this page and download the library: Download marko298/nova-single-record-resource 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/ */
marko298 / nova-single-record-resource example snippets
namespace App\Nova;
use Marko298\NovaSingleRecordResource\Traits\SupportSingleRecordNavigationLinks;
use Laravel\Nova\Resource as NovaResource;
abstract class Resource extends NovaResource
{
use SupportSingleRecordNavigationLinks;
...
}
class MyResource extends Resource
{
public static function singleRecord(): bool
{
return true;
}
}
class MyResource extends Resource
{
/**
* @return string|int
*/
public static function singleRecordId(): bool
{
return 1;
}
}