PageRenderTime 42ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/workbench/tommunz/support/extension.php

https://gitlab.com/eminiarts/tommunz
PHP | 323 lines | 98 code | 51 blank | 174 comment | 0 complexity | 1c2cc98c2ada74374ec7482133c8b32c MD5 | raw file
  1. <?php
  2. use Illuminate\Foundation\Application;
  3. use Cartalyst\Extensions\ExtensionInterface;
  4. use Cartalyst\Settings\Repository as Settings;
  5. use Cartalyst\Permissions\Container as Permissions;
  6. return [
  7. /*
  8. |--------------------------------------------------------------------------
  9. | Name
  10. |--------------------------------------------------------------------------
  11. |
  12. | This is your extension name and it is only required for
  13. | presentational purposes.
  14. |
  15. */
  16. 'name' => 'Support',
  17. /*
  18. |--------------------------------------------------------------------------
  19. | Slug
  20. |--------------------------------------------------------------------------
  21. |
  22. | This is your extension unique identifier and should not be changed as
  23. | it will be recognized as a new extension.
  24. |
  25. | Ideally, this should match the folder structure within the extensions
  26. | folder, but this is completely optional.
  27. |
  28. */
  29. 'slug' => 'tommunz/support',
  30. /*
  31. |--------------------------------------------------------------------------
  32. | Author
  33. |--------------------------------------------------------------------------
  34. |
  35. | Because everybody deserves credit for their work, right?
  36. |
  37. */
  38. 'author' => 'Emini Arts',
  39. /*
  40. |--------------------------------------------------------------------------
  41. | Description
  42. |--------------------------------------------------------------------------
  43. |
  44. | One or two sentences describing the extension for users to view when
  45. | they are installing the extension.
  46. |
  47. */
  48. 'description' => 'Tom Munz Support Extension',
  49. /*
  50. |--------------------------------------------------------------------------
  51. | Version
  52. |--------------------------------------------------------------------------
  53. |
  54. | Version should be a string that can be used with version_compare().
  55. | This is how the extensions versions are compared.
  56. |
  57. */
  58. 'version' => '0.1.0',
  59. /*
  60. |--------------------------------------------------------------------------
  61. | Requirements
  62. |--------------------------------------------------------------------------
  63. |
  64. | List here all the extensions that this extension requires to work.
  65. | This is used in conjunction with composer, so you should put the
  66. | same extension dependencies on your main composer.json require
  67. | key, so that they get resolved using composer, however you
  68. | can use without composer, at which point you'll have to
  69. | ensure that the required extensions are available.
  70. |
  71. */
  72. 'require' => [],
  73. /*
  74. |--------------------------------------------------------------------------
  75. | Autoload Logic
  76. |--------------------------------------------------------------------------
  77. |
  78. | You can define here your extension autoloading logic, it may either
  79. | be 'composer', 'platform' or a 'Closure'.
  80. |
  81. | If composer is defined, your composer.json file specifies the autoloading
  82. | logic.
  83. |
  84. | If platform is defined, your extension receives convetion autoloading
  85. | based on the Platform standards.
  86. |
  87. | If a Closure is defined, it should take two parameters as defined
  88. | bellow:
  89. |
  90. | object \Composer\Autoload\ClassLoader $loader
  91. | object \Illuminate\Foundation\Application $app
  92. |
  93. | Supported: "composer", "platform", "Closure"
  94. |
  95. */
  96. 'autoload' => 'composer',
  97. /*
  98. |--------------------------------------------------------------------------
  99. | Service Providers
  100. |--------------------------------------------------------------------------
  101. |
  102. | Define your extension service providers here. They will be dynamically
  103. | registered without having to include them in app/config/app.php.
  104. |
  105. */
  106. 'providers' => [
  107. 'Tommunz\Support\Providers\InvitationServiceProvider',
  108. ],
  109. /*
  110. |--------------------------------------------------------------------------
  111. | Routes
  112. |--------------------------------------------------------------------------
  113. |
  114. | Closure that is called when the extension is started. You can register
  115. | any custom routing logic here.
  116. |
  117. | The closure parameters are:
  118. |
  119. | object \Cartalyst\Extensions\ExtensionInterface $extension
  120. | object \Illuminate\Foundation\Application $app
  121. |
  122. */
  123. 'routes' => function(ExtensionInterface $extension, Application $app)
  124. {
  125. Route::group([
  126. 'prefix' => admin_uri().'/support/invitations',
  127. 'namespace' => 'Tommunz\Support\Controllers\Admin',
  128. ], function()
  129. {
  130. Route::get('/' , ['as' => 'admin.tommunz.support.invitations.all', 'uses' => 'InvitationsController@index']);
  131. Route::post('/', ['as' => 'admin.tommunz.support.invitations.all', 'uses' => 'InvitationsController@executeAction']);
  132. Route::get('grid', ['as' => 'admin.tommunz.support.invitations.grid', 'uses' => 'InvitationsController@grid']);
  133. Route::get('create' , ['as' => 'admin.tommunz.support.invitations.create', 'uses' => 'InvitationsController@create']);
  134. Route::post('create', ['as' => 'admin.tommunz.support.invitations.create', 'uses' => 'InvitationsController@store']);
  135. Route::get('{id}' , ['as' => 'admin.tommunz.support.invitations.edit' , 'uses' => 'InvitationsController@edit']);
  136. Route::post('{id}' , ['as' => 'admin.tommunz.support.invitations.edit' , 'uses' => 'InvitationsController@update']);
  137. Route::delete('{id}', ['as' => 'admin.tommunz.support.invitations.delete', 'uses' => 'InvitationsController@delete']);
  138. });
  139. Route::group([
  140. 'prefix' => 'support/invitations',
  141. 'namespace' => 'Tommunz\Support\Controllers\Frontend',
  142. ], function()
  143. {
  144. Route::get('/', ['as' => 'tommunz.support.invitations.index', 'uses' => 'InvitationsController@index']);
  145. });
  146. },
  147. /*
  148. |--------------------------------------------------------------------------
  149. | Database Seeds
  150. |--------------------------------------------------------------------------
  151. |
  152. | Platform provides a very simple way to seed your database with test
  153. | data using seed classes. All seed classes should be stored on the
  154. | `database/seeds` directory within your extension folder.
  155. |
  156. | The order you register your seed classes on the array below
  157. | matters, as they will be ran in the exact same order.
  158. |
  159. | The seeds array should follow the following structure:
  160. |
  161. | Vendor\Namespace\Database\Seeds\FooSeeder
  162. | Vendor\Namespace\Database\Seeds\BarSeeder
  163. |
  164. */
  165. 'seeds' => [
  166. ],
  167. /*
  168. |--------------------------------------------------------------------------
  169. | Permissions
  170. |--------------------------------------------------------------------------
  171. |
  172. | Register here all the permissions that this extension has. These will
  173. | be shown in the user management area to build a graphical interface
  174. | where permissions can be selected to allow or deny user access.
  175. |
  176. | For detailed instructions on how to register the permissions, please
  177. | refer to the following url https://cartalyst.com/manual/permissions
  178. |
  179. */
  180. 'permissions' => function(Permissions $permissions)
  181. {
  182. $permissions->group('invitation', function($g)
  183. {
  184. $g->name = 'Invitations';
  185. $g->permission('invitation.index', function($p)
  186. {
  187. $p->label = trans('tommunz/support::invitations/permissions.index');
  188. $p->controller('Tommunz\Support\Controllers\Admin\InvitationsController', 'index, grid');
  189. });
  190. $g->permission('invitation.create', function($p)
  191. {
  192. $p->label = trans('tommunz/support::invitations/permissions.create');
  193. $p->controller('Tommunz\Support\Controllers\Admin\InvitationsController', 'create, store');
  194. });
  195. $g->permission('invitation.edit', function($p)
  196. {
  197. $p->label = trans('tommunz/support::invitations/permissions.edit');
  198. $p->controller('Tommunz\Support\Controllers\Admin\InvitationsController', 'edit, update');
  199. });
  200. $g->permission('invitation.delete', function($p)
  201. {
  202. $p->label = trans('tommunz/support::invitations/permissions.delete');
  203. $p->controller('Tommunz\Support\Controllers\Admin\InvitationsController', 'delete');
  204. });
  205. });
  206. },
  207. /*
  208. |--------------------------------------------------------------------------
  209. | Widgets
  210. |--------------------------------------------------------------------------
  211. |
  212. | Closure that is called when the extension is started. You can register
  213. | all your custom widgets here. Of course, Platform will guess the
  214. | widget class for you, this is just for custom widgets or if you
  215. | do not wish to make a new class for a very small widget.
  216. |
  217. */
  218. 'widgets' => function()
  219. {
  220. },
  221. /*
  222. |--------------------------------------------------------------------------
  223. | Settings
  224. |--------------------------------------------------------------------------
  225. |
  226. | Register any settings for your extension. You can also configure
  227. | the namespace and group that a setting belongs to.
  228. |
  229. */
  230. 'settings' => function(Settings $settings, Application $app)
  231. {
  232. },
  233. /*
  234. |--------------------------------------------------------------------------
  235. | Menus
  236. |--------------------------------------------------------------------------
  237. |
  238. | You may specify the default various menu hierarchy for your extension.
  239. | You can provide a recursive array of menu children and their children.
  240. | These will be created upon installation, synchronized upon upgrading
  241. | and removed upon uninstallation.
  242. |
  243. | Menu children are automatically put at the end of the menu for extensions
  244. | installed through the Operations extension.
  245. |
  246. | The default order (for extensions installed initially) can be
  247. | found by editing app/config/platform.php.
  248. |
  249. */
  250. 'menus' => [
  251. 'admin' => [
  252. [
  253. 'slug' => 'admin-tommunz-support',
  254. 'name' => 'Support',
  255. 'class' => 'fa fa-circle-o',
  256. 'uri' => 'support',
  257. 'regex' => '/:admin\/support/i',
  258. 'children' => [
  259. [
  260. 'class' => 'fa fa-circle-o',
  261. 'name' => 'Invitations',
  262. 'uri' => 'support/invitations',
  263. 'regex' => '/:admin\/support\/invitation/i',
  264. 'slug' => 'admin-tommunz-support-invitation',
  265. ],
  266. ],
  267. ],
  268. ],
  269. 'main' => [
  270. ],
  271. ],
  272. ];