mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-01-29 11:08:53 +01:00
Remove the Service model and table.
This commit is contained in:
parent
5a8f0b3145
commit
2eb4bd1e69
@ -1,62 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Cachet HQ <support@cachethq.io>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Watson\Validating\ValidatingTrait;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property string $type
|
||||
* @property int $active
|
||||
* @property string $properties
|
||||
* @property \Carbon\Carbon $created_at
|
||||
* @property \Carbon\Carbon $updated_at
|
||||
* @property \Carbon\Carbon $deleted_at
|
||||
*/
|
||||
class Service extends Model
|
||||
{
|
||||
use ValidatingTrait;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $rules = [
|
||||
'type' => 'alpha_dash|required',
|
||||
'active' => 'required|in:0,1',
|
||||
'properties' => '',
|
||||
];
|
||||
|
||||
/**
|
||||
* Returns a decoded properties object for the service.
|
||||
*
|
||||
* @param string $properties
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
public function getPropertiesAttribute($properties)
|
||||
{
|
||||
return json_decode($properties);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the properties attribute which auto encodes to a JSON string.
|
||||
*
|
||||
* @param mixed $properties
|
||||
*/
|
||||
public function setPropertiesAttribute($properties)
|
||||
{
|
||||
$this->attributes['properties'] = json_encode($properties);
|
||||
}
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Cachet HQ <support@cachethq.io>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateServicesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('services', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('type');
|
||||
$table->boolean('active');
|
||||
$table->text('properties');
|
||||
$table->timestamps();
|
||||
|
||||
$table->index('active');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('services');
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user