gallery support
This commit is contained in:
@@ -32,13 +32,14 @@ class ArticleConductor extends Conductor
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $includes = ['attachments', 'user'];
|
||||
protected $includes = ['attachments', 'user', 'gallery'];
|
||||
|
||||
|
||||
/**
|
||||
* Run a scope query on the collection before anything else.
|
||||
*
|
||||
* @param Builder $builder The builder in use.
|
||||
* @return void
|
||||
*/
|
||||
public function scope(Builder $builder): void
|
||||
{
|
||||
@@ -127,6 +128,19 @@ class ArticleConductor extends Conductor
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Include Gallery Field.
|
||||
*
|
||||
* @param Model $model Them model.
|
||||
* @return mixed The model result.
|
||||
*/
|
||||
public function includeGallery(Model $model)
|
||||
{
|
||||
return $model->gallery()->get()->map(function ($item) {
|
||||
return MediaConductor::includeModel(request(), 'gallery', $item->media);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Include User Field.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user