Changing Tags
This commit is contained in:
@@ -1,60 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Shop\Admin;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\Tags;
|
||||
use App\Repositories\Shop\TagGroups;
|
||||
use App\DataTables\Shop\TagsDataTable;
|
||||
|
||||
class TagController extends Controller
|
||||
{
|
||||
public function index(TagsDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Shop.Admin.Tags.list');
|
||||
}
|
||||
|
||||
public function getDatatable(Request $request)
|
||||
{
|
||||
return Tags::getTables($request->all());
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data = [];
|
||||
$data['groups'] = TagGroups::getOptions();
|
||||
return view('Shop.Admin.Tags.create', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Tags::store($request->all());
|
||||
return redirect()->route('Shop.Admin.Tags.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = Tags::get($id);
|
||||
return view('Shop.Admin.Tags.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data = Tags::get($id);
|
||||
$data['groups'] = TagGroups::getOptions();
|
||||
return view('Shop.Admin.Tags.edit', $data);
|
||||
}
|
||||
|
||||
public function update(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return Tags::destroy($id);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
// Datatype for primary keys of your models.
|
||||
// used in migrations only
|
||||
'primary_keys_type' => 'integer', // 'string' or 'integer'
|
||||
|
||||
// Value of are passed through this before save of tags
|
||||
'normalizer' => '\Conner\Tagging\TaggingUtility::slug',
|
||||
|
||||
// Display value of tags are passed through (for front end display)
|
||||
'displayer' => '\Illuminate\Support\Str::title',
|
||||
|
||||
// Database connection for Conner\Taggable\Tag model to use
|
||||
// 'connection' => 'mysql',
|
||||
|
||||
// When deleting a model, remove all the tags first
|
||||
'untag_on_delete' => true,
|
||||
|
||||
// Auto-delete unused tags from the 'tags' database table (when they are used zero times)
|
||||
'delete_unused_tags' => false,
|
||||
|
||||
// Model to use to store the tags in the database
|
||||
'tag_model'=>'\Conner\Tagging\Model\Tag',
|
||||
|
||||
// Delimiter used within tags
|
||||
'delimiter' => '-',
|
||||
|
||||
// Model to use for the relation between tags and tagged records
|
||||
'tagged_model' => '\Conner\Tagging\Model\Tagged',
|
||||
];
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateUsersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('users', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('name');
|
||||
$table->string('email')->unique();
|
||||
$table->timestamp('email_verified_at')->nullable();
|
||||
$table->string('password');
|
||||
$table->rememberToken();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('users');
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreatePasswordResetsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('password_resets', function (Blueprint $table) {
|
||||
$table->string('email')->index();
|
||||
$table->string('token');
|
||||
$table->timestamp('created_at')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('password_resets');
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFailedJobsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('failed_jobs', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->text('connection');
|
||||
$table->text('queue');
|
||||
$table->longText('payload');
|
||||
$table->longText('exception');
|
||||
$table->timestamp('failed_at')->useCurrent();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('failed_jobs');
|
||||
}
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
<?php
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class LaratrustSetupTeams extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
// Create table for storing teams
|
||||
Schema::create('teams', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name')->unique();
|
||||
$table->string('display_name')->nullable();
|
||||
$table->string('description')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::table('role_user', function (Blueprint $table) {
|
||||
// Drop role foreign key and primary key
|
||||
$table->dropForeign(['role_id']);
|
||||
$table->dropPrimary(['user_id', 'role_id', 'user_type']);
|
||||
|
||||
// Add team_id column
|
||||
$table->unsignedInteger('team_id')->nullable();
|
||||
|
||||
// Create foreign keys
|
||||
$table->foreign('role_id')->references('id')->on('roles')
|
||||
->onUpdate('cascade')->onDelete('cascade');
|
||||
$table->foreign('team_id')->references('id')->on('teams')
|
||||
->onUpdate('cascade')->onDelete('cascade');
|
||||
|
||||
// Create a unique key
|
||||
$table->unique(['user_id', 'role_id', 'user_type', 'team_id']);
|
||||
});
|
||||
|
||||
Schema::table('permission_user', function (Blueprint $table) {
|
||||
// Drop permission foreign key and primary key
|
||||
$table->dropForeign(['permission_id']);
|
||||
$table->dropPrimary(['permission_id', 'user_id', 'user_type']);
|
||||
|
||||
$table->foreign('permission_id')->references('id')->on('permissions')
|
||||
->onUpdate('cascade')->onDelete('cascade');
|
||||
|
||||
// Add team_id column
|
||||
$table->unsignedInteger('team_id')->nullable();
|
||||
|
||||
$table->foreign('team_id')->references('id')->on('teams')
|
||||
->onUpdate('cascade')->onDelete('cascade');
|
||||
|
||||
$table->unique(['user_id', 'permission_id', 'user_type', 'team_id']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user