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/widgets / libs / Schemas / Forms.php
Size: Mime:
<?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');
		});

	}

}