Repository URL to install this package:
|
Version:
3.2.0 ▾
|
<?php
namespace Evsmash\Files;
use Evsmash\Core\Database\Eloquent;
use Evsmash\Core\Database\SoftDeleting;
use Evsmash\Core\Simpy\Params;
use Evsmash\Files\Schemas\AttachmentsGroups as Schema;
class AttachmentsGroup extends Eloquent {
use SoftDeleting;
// validate
static public function validate() {
return Schema::validate();
}
// has many attachments
public function attachments() {
return $this->hasMany('Evsmash\Files\Attachments', 'group_id');
}
// params
public function scopeParams($query, $params = false) {
$scope = new Params();
$scope->scope($query, $params);
$scope->order(['name' => 'asc']);
return $scope->query;
}
}