Repository URL to install this package:
|
Version:
3.3.1 ▾
|
<?php
namespace Evsmash\Widgets\Schemas;
use Evsmash\Core\Schemas\Base;
class Forms extends Base {
protected $table = 'forms';
// validate contact
static public function validateContact() {
return [
'name' => 'req|max:100',
'email' => 'req|email',
'phone' => 'phone',
'message' => 'req|max:10000'
];
}
// validate message
static public function validateMessage() {
return [
'email' => 'req|email',
'message' => 'req|max:10000'
];
}
// create
public function create() {
$this->schemaCreate(function($m) {
$m->increments('id');
$m->string('email', 50);
$m->text('data');
$m->nullabletimestamps();
$m->softDeletes();
});
}
// rebuild_1
public function rebuild_1() {
$this->schemaAdd('form', function($m) {
$m->string('form', 30)->after('id');
});
$this->schemaAdd('url', function($m) {
$m->string('url', 200)->after('form');
});
}
}