-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create [restful like] CRUD for Projects
* add Model, set fillables for auto-columns * add migrations * add Controller, use Restful * add View, use Edge (blade) renderer [and inherit layouts]
- Loading branch information
Showing
4 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 Project extends Controller | ||
{ | ||
use Restful; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 Project extends Model | ||
{ | ||
protected $fillable = ['title', 'description']; | ||
} |
22 changes: 22 additions & 0 deletions
22
admin/migrations/2018_09_09_232413_create_projects_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?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 CreateProjectsTable extends Migration | ||
{ | ||
public function up() | ||
{ | ||
$model = new \Joomplace\Component\Roadmap\Admin\Model\Project(); | ||
DB::schema()->create($model->getTable(), function (Blueprint $table) { | ||
$table->increments('id'); | ||
$table->string('title'); | ||
$table->string('description'); | ||
$table->timestamps(); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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\Project; | ||
|
||
|
||
use Joomplace\X\Renderer\Edge; | ||
use Joomplace\X\View; | ||
|
||
class Html extends View | ||
{ | ||
use Edge; | ||
} |