for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Yajra\CMS\Repositories\FileAsset;
use Yajra\CMS\Entities\Configuration;
use Yajra\CMS\Entities\FileAsset;
use Yajra\CMS\Repositories\RepositoryAbstract;
use Roumen\Asset\Asset;
/**
* Class FileAssetEloquentRepository
*
* @package Yajra\CMS\Repositories\Article
*/
class FileAssetEloquentRepository extends RepositoryAbstract implements FileAssetRepository
{
* Get repository model.
* @return \Yajra\CMS\Entities\FileAsset
public function getModel()
return new FileAsset();
}
* Get all file assets.
* @return \Illuminate\Database\Eloquent\Collection|static[]
public function all()
return $this->getModel()->query()->get();
* Get file asset by name.
* @param string $name
* @param null $category
public function getByName($name, $category = null)
if (is_null($category)) {
$category = config('asset.default');
return $this->getModel()
->where('name', $name)
->where('category', $category)
->first();