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 @@ ...@@ -3,6 +3,7 @@
namespace Modules\$MODULE_NAME$\Http\Controllers\Admin; namespace Modules\$MODULE_NAME$\Http\Controllers\Admin;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Modules\$MODULE_NAME$\Entities\$CLASS_NAME$; use Modules\$MODULE_NAME$\Entities\$CLASS_NAME$;
use Modules\$MODULE_NAME$\Repositories\$CLASS_NAME$Repository; use Modules\$MODULE_NAME$\Repositories\$CLASS_NAME$Repository;
use Modules\Core\Http\Controllers\Admin\AdminBaseController; use Modules\Core\Http\Controllers\Admin\AdminBaseController;
......
...@@ -12,7 +12,7 @@ class Create$MODULE_NAME$$PLURAL_CLASS_NAME$Table extends Migration ...@@ -12,7 +12,7 @@ class Create$MODULE_NAME$$PLURAL_CLASS_NAME$Table extends Migration
*/ */
public function up() public function up()
{ {
Schema::create('$LOWERCASE_MODULE_NAME$__$PLURAL_LOWERCASE_CLASS_NAME$', function(Blueprint $table) { Schema::create('$LOWERCASE_MODULE_NAME$__$PLURAL_LOWERCASE_CLASS_NAME$', function (Blueprint $table) {
$table->engine = 'InnoDB'; $table->engine = 'InnoDB';
$table->increments('id'); $table->increments('id');
// Your fields // Your fields
...@@ -27,6 +27,6 @@ class Create$MODULE_NAME$$PLURAL_CLASS_NAME$Table extends Migration ...@@ -27,6 +27,6 @@ class Create$MODULE_NAME$$PLURAL_CLASS_NAME$Table extends Migration
*/ */
public function down() public function down()
{ {
Schema::drop('$LOWERCASE_MODULE_NAME$__$PLURAL_LOWERCASE_CLASS_NAME$'); Schema::dropIfExists('$LOWERCASE_MODULE_NAME$__$PLURAL_LOWERCASE_CLASS_NAME$');
} }
} }
...@@ -12,7 +12,7 @@ class Create$MODULE_NAME$$CLASS_NAME$TranslationsTable extends Migration ...@@ -12,7 +12,7 @@ class Create$MODULE_NAME$$CLASS_NAME$TranslationsTable extends Migration
*/ */
public function up() public function up()
{ {
Schema::create('$LOWERCASE_MODULE_NAME$__$LOWERCASE_CLASS_NAME$_translations', function(Blueprint $table) { Schema::create('$LOWERCASE_MODULE_NAME$__$LOWERCASE_CLASS_NAME$_translations', function (Blueprint $table) {
$table->engine = 'InnoDB'; $table->engine = 'InnoDB';
$table->increments('id'); $table->increments('id');
// Your translatable fields // Your translatable fields
...@@ -31,6 +31,9 @@ class Create$MODULE_NAME$$CLASS_NAME$TranslationsTable extends Migration ...@@ -31,6 +31,9 @@ class Create$MODULE_NAME$$CLASS_NAME$TranslationsTable extends Migration
*/ */
public function down() public function down()
{ {
Schema::drop('$LOWERCASE_MODULE_NAME$__$LOWERCASE_CLASS_NAME$_translations'); 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