Repository URL to install this package:
|
Version:
3.4.2 ▾
|
<?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');
}
}
}