Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
evsmash/files / libs / AttachmentsGroup.php
Size: Mime:
<?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;

	}

}