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/banners / libs / Schemas / Imgmaps.php
Size: Mime:
<?php 

namespace Evsmash\Banners\Schemas;

use Evsmash\Core\Schemas\Base;

use Evsmash\Core\Database\Query;

class Imgmaps extends Base {

	protected $table = 'imgmaps';

	// validate
	static public function validate() {

		return [
			'rel' => 'req|max:50',
			'item' => 'req|int',
			'name' => 'req|max:100',
			'left' => 'req|int',
			'top' => 'req|int'
		];

	}

	// create
	public function create() {

		if(cfg('evsmash-banners-imgmaps-tables')) {

			$this->schemaCreate(function($m) {
				$m->increments('id');
				$m->string('rel', 50);
				$m->integer('item');
				$m->string('name', 100);
				$m->integer('left');
				$m->integer('top');
				$m->nullabletimestamps();
				$m->softDeletes();
			});

		}

	}

	// indexes
	public function indexes() {

		if(cfg('evsmash-banners-imgmaps-tables')) {
		
			$this->schemaIndexAdd('rel');

		}

	}

}