src/Model.php
public static function resource($record, Fields $fields = null, $flags = Resource::PARSE_DEFAULT)
    {
        return Resource::parseFromRecord(
            $record,
            static::class,
            $fields,
            $flags
        );
    }
public static function resource($record, Fields $fields = null, $flags = Resource::PARSE_DEFAULT)
    {
        return Resource::parseFromRecord(
            $record,
            static::class,
            $fields,
            $flags
        );
    }
public static function resource ( $ record , Fields $ fields = null , $ flags = Resource :: PARSE_DEFAULT ) { return Resource :: parseFromRecord ( $ record , static :: class , $ fields , $ flags ) ; }
Prepare an individual resource
@param array|object $record A single record fetched from database
@param Fields|null $fields
@param int $flags
@return Resource|null
@throws \Exception
@uses Resource::parseFromRecord
@example
```php
Model::resource(
[
'id' => '10',
'title' => 'Hello world'
],
null,
Resource::PARSE_DEFAULT | Resource::PARSE_RELATIONSHIP_DATA
);
```
Prepare an individual resource