Skip to content

Commit

Permalink
Merge pull request #11 from CalderaWP/feature/8
Browse files Browse the repository at this point in the history
Feature/8
  • Loading branch information
New0 authored Sep 4, 2018
2 parents 5128f5c + 86f4355 commit 77ddd2f
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
36 changes: 36 additions & 0 deletions app/File.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Storage;

class File extends Model
{
/** @inheritdoc */
protected $table = [
'account_id',
's3_id',
'cdn_url'
];

/** @inheritdoc */
public $timestamps = true;

/** @inheritdoc */
public function toArray()
{

$array = [
'id' => $this->id,
'account_id' => $this->getAccountId(),
's3_id' => $this->getS3Id(),
'cdn_url' => $this->getCdnUrl()
];

return $array;

}

}
34 changes: 34 additions & 0 deletions database/migrations/2018_09_02_133835_creates_files_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateFilesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('files', function (Blueprint $table) {
$table->increments('id');
$table->integer('account_id');
$table->integer('s3_id');
$table->string('cdn_url');
$table->timestamps();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('files');
}
}

0 comments on commit 77ddd2f

Please sign in to comment.