Skip to content
This repository has been archived by the owner on Oct 4, 2022. It is now read-only.

Commit

Permalink
Blog related
Browse files Browse the repository at this point in the history
  • Loading branch information
Yash committed Sep 18, 2015
1 parent e03b20e commit 5c8dbeb
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
6 changes: 4 additions & 2 deletions app/Models/Blog.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ class Blog extends Model {
"visibility" => "required",
"type" => "required",
"body" => "required",

"category_id" => "required",
"author" => "required",
"isCommentsAllowed" => "required",
"CommentsDays" => "required",
"is_comments_allowed" => "required",
"comments_days" => "required",

];

Expand Down
20 changes: 20 additions & 0 deletions config/laravelmart.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,26 @@
],
"index" => [ 'title', 'url' ,'status', 'visibility','type', 'parent_id' ]
],

'blogs' => [
"fields" => [
['title', 'Title' , 'text' , ['Placeholder' => 'Enter Title'] ],
['url', 'Url' , 'text' , ['Placeholder' => 'Enter Url'] ],
['status', 'Status' , 'select' , [ "options"=> [ 'draft' => 'Draft','live' => 'Live'] ,"selected" => 'live' ] ],
['visibility', 'Visibility' , 'select' , [ "options"=> [ 'public' => 'Public','private' => 'Private'] ,"selected" => 'public'] ],
['type', 'Type' , 'select' , [ "options"=> [ 'html' => 'Html','md' => 'Markdown'] ,"selected" => 'Html' ] ],
['body', 'Body' , 'textarea' , [] ],

['category_id','Categories:', 'select' , [ "dynamic"=> "/category/list","multiple"=>""] ],
['author', 'Author' , 'text' , ['Placeholder' => 'Enter author name'] ],
['is_comments_allowed', 'Is Comments Allowed' , 'text' , ['Placeholder' => 'Enter 0 block comment'] ],
['comments_days', 'Allowed Comments Days' , 'text' , ['Placeholder' => 'Enter 0 for unlimited days'] ],

['header', 'Header' , 'textarea' , [] ]
,
],
"index" => [ 'title', 'url' ,'status', 'visibility','type', 'parent_id' ]
],



Expand Down
7 changes: 4 additions & 3 deletions database/migrations/2015_09_18_110000_create_blog_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public function up() {
Schema::create("blogs", function($table) {
$table->engine = "InnoDB";
$table->increments("id");
$table->integer("parent_id")->nullable();

$table->string("title");
$table->string("url")->unique();
//Draft, Pending Review, Live
Expand All @@ -24,9 +24,10 @@ public function up() {

$table->text("header")->nullable();

$table->integer('category_id');
$table->text("author")->default('Kara Guru');
$table->boolean('isCommentsAllowed')->default(true);
$table->integer('CommentsDays')->default(0); //0 is unlimited days
$table->boolean('is_comments_allowed')->default(true);
$table->integer('comments_days')->default(0); //0 is unlimited days

$table->timestamps();
$table->softDeletes();
Expand Down

0 comments on commit 5c8dbeb

Please sign in to comment.