Commit 2436901f authored by Micheal Mand's avatar Micheal Mand Committed by Nicolas Widart

Use PSR-2 for Workshop stubs (#244)

Signed-off-by: 's avatarMicheal Mand <micheal@kmdwebdesigns.com>
parent 014b5383
......@@ -3,6 +3,7 @@
namespace Modules\$MODULE_NAME$\Http\Controllers\Admin;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Modules\$MODULE_NAME$\Entities\$CLASS_NAME$;
use Modules\$MODULE_NAME$\Repositories\$CLASS_NAME$Repository;
use Modules\Core\Http\Controllers\Admin\AdminBaseController;
......
......@@ -5,28 +5,28 @@ use Illuminate\Database\Migrations\Migration;
class Create$MODULE_NAME$$PLURAL_CLASS_NAME$Table extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('$LOWERCASE_MODULE_NAME$__$PLURAL_LOWERCASE_CLASS_NAME$', function(Blueprint $table) {
$table->engine = 'InnoDB';
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('$LOWERCASE_MODULE_NAME$__$PLURAL_LOWERCASE_CLASS_NAME$', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->increments('id');
// Your fields
$table->timestamps();
});
}
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('$LOWERCASE_MODULE_NAME$__$PLURAL_LOWERCASE_CLASS_NAME$');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('$LOWERCASE_MODULE_NAME$__$PLURAL_LOWERCASE_CLASS_NAME$');
}
}
......@@ -5,15 +5,15 @@ use Illuminate\Database\Migrations\Migration;
class Create$MODULE_NAME$$CLASS_NAME$TranslationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('$LOWERCASE_MODULE_NAME$__$LOWERCASE_CLASS_NAME$_translations', function(Blueprint $table) {
$table->engine = 'InnoDB';
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('$LOWERCASE_MODULE_NAME$__$LOWERCASE_CLASS_NAME$_translations', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->increments('id');
// Your translatable fields
......@@ -21,16 +21,19 @@ class Create$MODULE_NAME$$CLASS_NAME$TranslationsTable extends Migration
$table->string('locale')->index();
$table->unique(['$LOWERCASE_CLASS_NAME$_id', 'locale']);
$table->foreign('$LOWERCASE_CLASS_NAME$_id')->references('id')->on('$LOWERCASE_MODULE_NAME$__$PLURAL_LOWERCASE_CLASS_NAME$')->onDelete('cascade');
});
}
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('$LOWERCASE_MODULE_NAME$__$LOWERCASE_CLASS_NAME$_translations');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('$LOWERCASE_MODULE_NAME$__$LOWERCASE_CLASS_NAME$_translations', function (Blueprint $table) {
$table->dropForeign(['$LOWERCASE_CLASS_NAME$_id']);
});
Schema::dropIfExists('$LOWERCASE_MODULE_NAME$__$LOWERCASE_CLASS_NAME$_translations');
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment