Skip to content

Commit

Permalink
add Ideas CRUD
Browse files Browse the repository at this point in the history
* add MVC structure
* add migration
  • Loading branch information
alex7r committed Sep 10, 2018
1 parent 8c419af commit d37cd29
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 0 deletions.
15 changes: 15 additions & 0 deletions admin/Controller/Idea.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
/**
* Copyright (c) 2018. JoomPlace, all rights reserved
*/

namespace Joomplace\Component\Roadmap\Admin\Controller;


use Joomplace\X\Controller;
use Joomplace\X\Helper\Restful;

class Idea extends Controller
{
use Restful;
}
14 changes: 14 additions & 0 deletions admin/Model/Idea.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php
/**
* Copyright (c) 2018. JoomPlace, all rights reserved
*/

namespace Joomplace\Component\Roadmap\Admin\Model;


use Joomplace\X\Model;

class Idea extends Model
{
protected $fillable = ['title', 'description', 'project_id'];
}
23 changes: 23 additions & 0 deletions admin/migrations/2018_09_10_010431_create_ideas_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php
/**
* Copyright (c) 2018. JoomPlace, all rights reserved
*/

use Illuminate\Database\Capsule\Manager as DB;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateIdeasTable extends Migration
{
public function up()
{
$model = new \Joomplace\Component\Roadmap\Admin\Model\Idea();
DB::schema()->create($model->getTable(), function (Blueprint $table) {
$table->increments('id');
$table->string('title');
$table->string('description');
$table->integer('project_id', false, true)->comment('id of the related project');
$table->timestamps();
});
}
}
15 changes: 15 additions & 0 deletions admin/view/Idea/Html.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
/**
* Copyright (c) 2018. JoomPlace, all rights reserved
*/

namespace Joomplace\Component\Roadmap\Admin\view\Idea;


use Joomplace\X\Renderer\Edge;
use Joomplace\X\View;

class Html extends View
{
use Edge;
}

0 comments on commit d37cd29

Please sign in to comment.