Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
2436901f
Commit
2436901f
authored
Sep 11, 2016
by
Micheal Mand
Committed by
Nicolas Widart
Sep 11, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use PSR-2 for Workshop stubs (#244)
Signed-off-by:
Micheal Mand
<
micheal@kmdwebdesigns.com
>
parent
014b5383
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
40 deletions
+44
-40
admin-controller.stub
Modules/Workshop/Scaffold/Module/stubs/admin-controller.stub
+1
-0
create-table-migration.stub
...orkshop/Scaffold/Module/stubs/create-table-migration.stub
+20
-20
create-translation-table-migration.stub
...fold/Module/stubs/create-translation-table-migration.stub
+23
-20
No files found.
Modules/Workshop/Scaffold/Module/stubs/admin-controller.stub
View file @
2436901f
...
@@ -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
;
...
...
Modules/Workshop/Scaffold/Module/stubs/create-table-migration.stub
View file @
2436901f
...
@@ -5,28 +5,28 @@ use Illuminate\Database\Migrations\Migration;
...
@@ -5,28 +5,28 @@ use Illuminate\Database\Migrations\Migration;
class
Create
$MODULE_NAME$$PLURAL_CLASS_NAME$Table
extends
Migration
class
Create
$MODULE_NAME$$PLURAL_CLASS_NAME$Table
extends
Migration
{
{
/**
/**
* Run the migrations.
* Run the migrations.
*
*
* @return void
* @return void
*/
*/
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
$table
->
timestamps
();
$table
->
timestamps
();
});
});
}
}
/**
/**
* Reverse the migrations.
* Reverse the migrations.
*
*
* @return void
* @return void
*/
*/
public
function
down
()
public
function
down
()
{
{
Schema
::
drop
(
'$LOWERCASE_MODULE_NAME$__$PLURAL_LOWERCASE_CLASS_NAME$'
);
Schema
::
dropIfExists
(
'$LOWERCASE_MODULE_NAME$__$PLURAL_LOWERCASE_CLASS_NAME$'
);
}
}
}
}
Modules/Workshop/Scaffold/Module/stubs/create-translation-table-migration.stub
View file @
2436901f
...
@@ -5,15 +5,15 @@ use Illuminate\Database\Migrations\Migration;
...
@@ -5,15 +5,15 @@ use Illuminate\Database\Migrations\Migration;
class
Create
$MODULE_NAME$$CLASS_NAME$TranslationsTable
extends
Migration
class
Create
$MODULE_NAME$$CLASS_NAME$TranslationsTable
extends
Migration
{
{
/**
/**
* Run the migrations.
* Run the migrations.
*
*
* @return void
* @return void
*/
*/
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
...
@@ -21,16 +21,19 @@ class Create$MODULE_NAME$$CLASS_NAME$TranslationsTable extends Migration
...
@@ -21,16 +21,19 @@ class Create$MODULE_NAME$$CLASS_NAME$TranslationsTable extends Migration
$table
->
string
(
'locale'
)
->
index
();
$table
->
string
(
'locale'
)
->
index
();
$table
->
unique
([
'$LOWERCASE_CLASS_NAME$_id'
,
'locale'
]);
$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'
);
$table
->
foreign
(
'$LOWERCASE_CLASS_NAME$_id'
)
->
references
(
'id'
)
->
on
(
'$LOWERCASE_MODULE_NAME$__$PLURAL_LOWERCASE_CLASS_NAME$'
)
->
onDelete
(
'cascade'
);
});
});
}
}
/**
/**
* Reverse the migrations.
* Reverse the migrations.
*
*
* @return void
* @return void
*/
*/
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'
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment