Rewrite the tags implementation. Closes #391

This commit is contained in:
James Brooks
2015-01-16 09:51:22 +00:00
parent a25b12914a
commit fcc84ba356
9 changed files with 206 additions and 6 deletions
@@ -1,5 +1,5 @@
<?php
return array(
return [
/*
|--------------------------------------------------------------------------
@@ -26,7 +26,7 @@ return array(
|
*/
'proxies' => array(
'proxies' => [
'204.93.240.0',
'204.93.177.0',
'199.27.128.0',
@@ -46,6 +46,6 @@ return array(
'2803:f800::',
'2405:b500::',
'2405:8100::',
)
],
);
];
@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateTagsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('tags', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('slug');
$table->timestamps();
$table->unique(['name', 'slug']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('tags');
}
}
@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateComponentTagTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('component_tag', function (Blueprint $table) {
$table->increments('id');
$table->integer('component_id');
$table->integer('tag_id');
$table->index('component_id');
$table->index('tag_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('component_tag');
}
}
@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AlterTableComponentsDropTagsColumn extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('components', function (Blueprint $table) {
$table->dropColumn('tags');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('components', function (Blueprint $table) {
$table->text('tags')->after('link');
});
}
}
+1 -1
View File
@@ -50,7 +50,7 @@
</div>
<div class="form-group">
<label>{{ trans('forms.components.tags') }}</label>
<textarea name="component[tags]" class="form-control" rows="2"></textarea>
<input name="component[tags]" class="form-control" />
<span class="help-block">{{ trans('forms.components.tags-help') }}</span>
</div>
</fieldset>
@@ -50,7 +50,7 @@
</div>
<div class="form-group">
<label>{{ trans('forms.components.tags') }}</label>
<textarea name="component[tags]" class="form-control" rows="2">{{ $component->tags }}</textarea>
<input name="component[tags]" class="form-control" value="{{ $component->tagsList }}" />
<span class="help-block">{{ trans('forms.components.tags-help') }}</span>
</div>
</fieldset>