Permalink
Browse files

Initial commit.

  • Loading branch information...
0 parents commit 1041c9afc18c1bd687b06fe2289d68c4f3b263e4 @stidges stidges committed Feb 18, 2014
Showing with 29,756 additions and 0 deletions.
  1. +1 −0 .gitattributes
  2. +6 −0 .gitignore
  3. +39 −0 Boxfile
  4. +21 −0 LICENSE
  5. +125 −0 app/Controllers/Admin/CategoriesController.php
  6. +108 −0 app/Controllers/Admin/TagsController.php
  7. +41 −0 app/Controllers/Admin/UsersController.php
  8. +139 −0 app/Controllers/AuthController.php
  9. +86 −0 app/Controllers/BaseController.php
  10. +152 −0 app/Controllers/BrowseController.php
  11. +76 −0 app/Controllers/FeedsController.php
  12. +50 −0 app/Controllers/HomeController.php
  13. +89 −0 app/Controllers/RemindersController.php
  14. +46 −0 app/Controllers/SearchController.php
  15. +110 −0 app/Controllers/SitemapController.php
  16. +105 −0 app/Controllers/TricksController.php
  17. +142 −0 app/Controllers/UserController.php
  18. +158 −0 app/Controllers/UserTricksController.php
  19. +25 −0 app/Tricks/Category.php
  20. +10 −0 app/Tricks/Exceptions/AbstractNotFoundException.php
  21. +8 −0 app/Tricks/Exceptions/CategoryNotFoundException.php
  22. +10 −0 app/Tricks/Exceptions/GithubEmailNotVerifiedException.php
  23. +8 −0 app/Tricks/Exceptions/TagNotFoundException.php
  24. +8 −0 app/Tricks/Exceptions/UserNotFoundException.php
  25. +18 −0 app/Tricks/Facades/Disqus.php
  26. +18 −0 app/Tricks/Facades/Github.php
  27. +18 −0 app/Tricks/Facades/GithubProvider.php
  28. +18 −0 app/Tricks/Facades/ImageUpload.php
  29. +18 −0 app/Tricks/Facades/Navigation.php
  30. +210 −0 app/Tricks/Presenters/TrickPresenter.php
  31. +58 −0 app/Tricks/Presenters/UserPresenter.php
  32. +26 −0 app/Tricks/Profile.php
  33. +21 −0 app/Tricks/Providers/NavigationServiceProvider.php
  34. +41 −0 app/Tricks/Providers/RepositoryServiceProvider.php
  35. +58 −0 app/Tricks/Providers/SocialServiceProvider.php
  36. +21 −0 app/Tricks/Providers/UploadServiceProvider.php
  37. +77 −0 app/Tricks/Repositories/CategoryRepositoryInterface.php
  38. +36 −0 app/Tricks/Repositories/Eloquent/AbstractRepository.php
  39. +173 −0 app/Tricks/Repositories/Eloquent/CategoryRepository.php
  40. +77 −0 app/Tricks/Repositories/Eloquent/ProfileRepository.php
  41. +144 −0 app/Tricks/Repositories/Eloquent/TagRepository.php
  42. +333 −0 app/Tricks/Repositories/Eloquent/TrickRepository.php
  43. +186 −0 app/Tricks/Repositories/Eloquent/UserRepository.php
  44. +37 −0 app/Tricks/Repositories/ProfileRepositoryInterface.php
  45. +62 −0 app/Tricks/Repositories/TagRepositoryInterface.php
  46. +149 −0 app/Tricks/Repositories/TrickRepositoryInterface.php
  47. +66 −0 app/Tricks/Repositories/UserRepositoryInterface.php
  48. +103 −0 app/Tricks/Services/Forms/AbstractForm.php
  49. +16 −0 app/Tricks/Services/Forms/CategoryForm.php
  50. +63 −0 app/Tricks/Services/Forms/RegistrationForm.php
  51. +76 −0 app/Tricks/Services/Forms/SettingsForm.php
  52. +15 −0 app/Tricks/Services/Forms/TagForm.php
  53. +57 −0 app/Tricks/Services/Forms/TrickEditForm.php
  54. +31 −0 app/Tricks/Services/Forms/TrickForm.php
  55. +144 −0 app/Tricks/Services/Navigation/Builder.php
  56. +182 −0 app/Tricks/Services/Social/Disqus.php
  57. +130 −0 app/Tricks/Services/Social/Github.php
  58. +178 −0 app/Tricks/Services/Upload/ImageUploadService.php
  59. +25 −0 app/Tricks/Tag.php
  60. +69 −0 app/Tricks/Trick.php
  61. +116 −0 app/Tricks/User.php
  62. 0 app/commands/.gitkeep
  63. +194 −0 app/config/app.php
  64. +71 −0 app/config/auth.php
  65. +89 −0 app/config/cache.php
  66. +18 −0 app/config/compile.php
  67. +41 −0 app/config/config.php
  68. +124 −0 app/config/database.php
  69. +5 −0 app/config/local/app.php
  70. +5 −0 app/config/local/cache.php
  71. +5 −0 app/config/local/queue.php
  72. +7 −0 app/config/local/session.php
  73. +124 −0 app/config/mail.php
  74. +49 −0 app/config/navigation.php
  75. 0 app/config/packages/.gitkeep
  76. +48 −0 app/config/packages/itsgoingd/clockwork/config.php
  77. 0 app/config/packages/thomaswelton/laravel-gravatar/.gitkeep
  78. +6 −0 app/config/packages/thomaswelton/laravel-gravatar/config.php
  79. +60 −0 app/config/queue.php
  80. +58 −0 app/config/remote.php
  81. +139 −0 app/config/session.php
  82. +19 −0 app/config/social.php
  83. +20 −0 app/config/testing/cache.php
  84. +21 −0 app/config/testing/session.php
  85. +31 −0 app/config/view.php
  86. +31 −0 app/config/workbench.php
  87. 0 app/database/migrations/.gitkeep
  88. +28 −0 app/database/migrations/2013_11_13_222806_create_users_table.php
  89. +40 −0 app/database/migrations/2013_11_13_222807_create_tricks_table.php
  90. +35 −0 app/database/migrations/2013_11_13_222808_create_tags_table.php
  91. +26 −0 app/database/migrations/2013_11_13_222809_create_categories_table.php
  92. +41 −0 app/database/migrations/2013_11_13_222810_create_votes_table.php
  93. +41 −0 app/database/migrations/2013_11_13_222811_create_tag_trick_table.php
  94. +40 −0 app/database/migrations/2013_11_13_222812_create_category_trick_table.php
  95. +45 −0 app/database/migrations/2013_11_13_222813_create_profiles_table.php
  96. +33 −0 app/database/migrations/2013_11_20_072925_add_order_to_category_table.php
  97. +33 −0 app/database/migrations/2013_11_22_072925_add_spam_to_tricks_table.php
  98. +33 −0 app/database/migrations/2013_11_25_202456_create_password_reminders_table.php
  99. 0 app/database/production.sqlite
  100. 0 app/database/seeds/.gitkeep
  101. +33 −0 app/database/seeds/CategoriesTableSeeder.php
  102. +20 −0 app/database/seeds/DatabaseSeeder.php
  103. +34 −0 app/database/seeds/TagsTableSeeder.php
  104. +76 −0 app/database/seeds/TricksTableSeeder.php
  105. +27 −0 app/database/seeds/UsersTableSeeder.php
  106. +99 −0 app/filters.php
  107. +20 −0 app/lang/en/pagination.php
  108. +24 −0 app/lang/en/reminders.php
  109. +98 −0 app/lang/en/validation.php
  110. +92 −0 app/routes.php
  111. +13 −0 app/start/artisan.php
  112. +65 −0 app/start/global.php
  113. +3 −0 app/start/local.php
  114. +2 −0 app/storage/.gitignore
  115. +2 −0 app/storage/cache/.gitignore
  116. +2 −0 app/storage/logs/.gitignore
  117. +2 −0 app/storage/meta/.gitignore
  118. +2 −0 app/storage/sessions/.gitignore
  119. +2 −0 app/storage/views/.gitignore
  120. +17 −0 app/tests/ExampleTest.php
  121. +19 −0 app/tests/TestCase.php
  122. +40 −0 app/views/admin/categories/edit.blade.php
  123. +136 −0 app/views/admin/categories/list.blade.php
  124. +1 −0 app/views/admin/categories/new.blade.php
  125. +33 −0 app/views/admin/tags/edit.blade.php
  126. +113 −0 app/views/admin/tags/list.blade.php
  127. +1 −0 app/views/admin/tags/new.blade.php
  128. +1 −0 app/views/admin/tricks/edit.blade.php
  129. +1 −0 app/views/admin/tricks/list.blade.php
  130. +1 −0 app/views/admin/tricks/new.blade.php
  131. +1 −0 app/views/admin/users/edit.blade.php
  132. +46 −0 app/views/admin/users/list.blade.php
  133. +1 −0 app/views/admin/users/new.blade.php
  134. +33 −0 app/views/browse/categories.blade.php
  135. +26 −0 app/views/browse/index.blade.php
  136. +33 −0 app/views/browse/tags.blade.php
  137. +13 −0 app/views/emails/auth/reminder.blade.php
  138. +27 −0 app/views/feeds/atom.blade.php
  139. +22 −0 app/views/feeds/rss.blade.php
  140. +49 −0 app/views/home/about.blade.php
  141. +22 −0 app/views/home/error.blade.php
  142. +16 −0 app/views/home/index.blade.php
  143. +52 −0 app/views/home/login.blade.php
  144. +1 −0 app/views/home/privacy.blade.php
  145. +57 −0 app/views/home/register.blade.php
  146. +1 −0 app/views/home/terms.blade.php
  147. +55 −0 app/views/layouts/main.blade.php
  148. +5 −0 app/views/partials/footer.blade.php
  149. +55 −0 app/views/partials/navigation.blade.php
  150. +4 −0 app/views/partials/search.blade.php
  151. +34 −0 app/views/password/remind.blade.php
  152. +43 −0 app/views/password/reset.blade.php
  153. +41 −0 app/views/search/result.blade.php
  154. +20 −0 app/views/tricks/card.blade.php
  155. +18 −0 app/views/tricks/delete.blade.php
  156. +74 −0 app/views/tricks/edit.blade.php
  157. +33 −0 app/views/tricks/grid.blade.php
  158. +77 −0 app/views/tricks/new.blade.php
  159. +131 −0 app/views/tricks/single.blade.php
  160. +16 −0 app/views/user/favorites.blade.php
  161. +31 −0 app/views/user/profile.blade.php
  162. +45 −0 app/views/user/public.blade.php
  163. +197 −0 app/views/user/settings.blade.php
  164. +74 −0 artisan
  165. +75 −0 bootstrap/autoload.php
  166. +57 −0 bootstrap/paths.php
  167. +72 −0 bootstrap/start.php
  168. +43 −0 composer.json
  169. +18 −0 phpunit.xml
  170. +141 −0 public/.htaccess
  171. BIN public/css/Jcrop.gif
  172. +5,981 −0 public/css/bootstrap.css
  173. +19 −0 public/css/bootstrap.min.css
  174. +159 −0 public/css/highlight/arta.css
  175. +50 −0 public/css/highlight/ascetic.css
  176. +104 −0 public/css/highlight/brown_paper.css
  177. BIN public/css/highlight/brown_papersq.png
  178. +104 −0 public/css/highlight/dark.css
  179. +149 −0 public/css/highlight/default.css
  180. +131 −0 public/css/highlight/docco.css
  181. +112 −0 public/css/highlight/far.css
  182. +113 −0 public/css/highlight/foundation.css
  183. +129 −0 public/css/highlight/github.css
  184. +145 −0 public/css/highlight/googlecode.css
  185. +121 −0 public/css/highlight/idea.css
  186. +105 −0 public/css/highlight/ir_black.css
  187. +151 −0 public/css/highlight/laratricks.css
  188. +122 −0 public/css/highlight/magula.css
  189. +59 −0 public/css/highlight/mono-blue.css
  190. +124 −0 public/css/highlight/monokai.css
  191. +101 −0 public/css/highlight/monokai_sublime.css
  192. +153 −0 public/css/highlight/obsidian.css
  193. +104 −0 public/css/highlight/pojoaque.css
  194. BIN public/css/highlight/pojoaque.jpg
  195. +181 −0 public/css/highlight/railscasts.css
  196. +114 −0 public/css/highlight/rainbow.css
  197. +112 −0 public/css/highlight/school_book.css
  198. BIN public/css/highlight/school_book.png
  199. +91 −0 public/css/highlight/solarized_dark.css
  200. +91 −0 public/css/highlight/solarized_light.css
  201. +159 −0 public/css/highlight/sunburst.css
  202. +52 −0 public/css/highlight/tomorrow-night-blue.css
  203. +51 −0 public/css/highlight/tomorrow-night-bright.css
  204. +51 −0 public/css/highlight/tomorrow-night-eighties.css
  205. +52 −0 public/css/highlight/tomorrow-night.css
  206. +49 −0 public/css/highlight/tomorrow.css
  207. +88 −0 public/css/highlight/vs.css
  208. +156 −0 public/css/highlight/xcode.css
  209. +116 −0 public/css/highlight/zenburn.css
  210. +124 −0 public/css/jquery.Jcrop.min.css
  211. +450 −0 public/css/laratricks.css
  212. +3 −0 public/css/laratricks.min.css
  213. +211 −0 public/css/styles.css
  214. +36 −0 public/css/ui.totop.css
  215. BIN public/favicon.ico
  216. BIN public/favicon.jpg
  217. BIN public/fonts/glyphicons-halflings-regular.eot
  218. +228 −0 public/fonts/glyphicons-halflings-regular.svg
  219. BIN public/fonts/glyphicons-halflings-regular.ttf
  220. BIN public/fonts/glyphicons-halflings-regular.woff
  221. BIN public/img/avatar/7568ca66ee70f18cfaad8caa8ff6d7576891a3e4.jpg
  222. BIN public/img/avatar/865643780afe76667ffcd467c78a30ad44fc5b7d.jpg
  223. +1 −0 public/img/avatar/index.php
  224. +1 −0 public/img/avatar/temp/index.php
  225. BIN public/img/icon-comments.png
  226. BIN public/img/icon-likes.png
  227. BIN public/img/icon-search.png
  228. BIN public/img/icon-views.png
  229. +1 −0 public/img/index.php
  230. BIN public/img/laratricks-logo.png
  231. BIN public/img/logo-big.png
  232. BIN public/img/logo-white.png
  233. BIN public/img/logo-white50x34.png
  234. BIN public/img/logo.png
  235. BIN public/img/logo@2x.png
  236. BIN public/img/no-userpic-big.gif
  237. BIN public/img/pattern.jpg
  238. BIN public/img/thumbnails/default.jpg
  239. BIN public/img/ui.totop.png
  240. +49 −0 public/index.php
  241. +17 −0 public/js/new-trick-backup.js
  242. +532 −0 public/js/selectize/css/selectize.bootstrap2.css
  243. +416 −0 public/js/selectize/css/selectize.bootstrap3.css
  244. +343 −0 public/js/selectize/css/selectize.css
  245. +417 −0 public/js/selectize/css/selectize.default.css
  246. +396 −0 public/js/selectize/css/selectize.legacy.css
  247. +2,567 −0 public/js/selectize/js/selectize.js
  248. +2 −0 public/js/selectize/js/selectize.min.js
  249. +3,038 −0 public/js/selectize/js/standalone/selectize.js
  250. +3 −0 public/js/selectize/js/standalone/selectize.min.js
  251. +16 −0 public/js/selectize/less/plugins/drag_drop.less
  252. +20 −0 public/js/selectize/less/plugins/dropdown_header.less
  253. +17 −0 public/js/selectize/less/plugins/optgroup_columns.less
  254. +30 −0 public/js/selectize/less/plugins/remove_button.less
  255. +161 −0 public/js/selectize/less/selectize.bootstrap2.less
  256. +136 −0 public/js/selectize/less/selectize.bootstrap3.less
  257. +78 −0 public/js/selectize/less/selectize.default.less
  258. +75 −0 public/js/selectize/less/selectize.legacy.less
  259. +279 −0 public/js/selectize/less/selectize.less
  260. +19 −0 public/js/trick-grid-backup.js
  261. +22 −0 public/js/trick-like-backup.js
  262. +1 −0 public/js/trick-new-edit.min.js
  263. +1 −0 public/js/vendor/dropzone.min.js
  264. +141 −0 public/js/vendor/easing.js
  265. +1 −0 public/js/vendor/highlight.pack.js
  266. +6 −0 public/js/vendor/jquery-ui-1.10.3.custom.min.js
  267. +80 −0 public/js/vendor/jquery.spin.js
  268. +5 −0 public/js/vendor/jquery.ui.totop.min.js
  269. +9 −0 public/js/vendor/masonry.pkgd.min.js
  270. +2 −0 public/js/vendor/placeholder.min.js
  271. +1 −0 public/js/vendor/spin.min.js
  272. +59 −0 public/js/vendor/uploader/FileAPI.exif.js
  273. BIN public/js/vendor/uploader/FileAPI.flash.camera.swf
  274. BIN public/js/vendor/uploader/FileAPI.flash.image.swf
  275. BIN public/js/vendor/uploader/FileAPI.flash.swf
  276. +3 −0 public/js/vendor/uploader/FileAPI.min.js
  277. +9 −0 public/js/vendor/uploader/crossdomain.xml
  278. +22 −0 public/js/vendor/uploader/jquery.Jcrop.min.js
  279. +1,050 −0 public/js/vendor/uploader/jquery.fileapi.js
  280. +2 −0 public/js/vendor/uploader/jquery.fileapi.min.js
  281. 0 public/packages/.gitkeep
  282. +2 −0 public/robots.txt
  283. +125 −0 readme.md
  284. +19 −0 server.php
@@ -0,0 +1 @@
+* text=auto
@@ -0,0 +1,6 @@
+/bootstrap/compiled.php
+/vendor
+composer.phar
+composer.lock
+.DS_Store
+Thumbs.db
@@ -0,0 +1,39 @@
+web1:
+ document_root: public
+ php_version: 5.4.14
+ php_upload_max_filesize: "10M"
+ php_post_max_size: "10M"
+ php_extensions:
+ - mbstring
+ - mcrypt
+ - curl
+ - gd
+ - pdo_mysql
+ - redis
+ - zip
+ - xcache
+ php_session_save_handler: redis
+ php_session_save_path: "tcp://tunnel.pagodabox.com:6379"
+ shared_writable_dirs:
+ - app/storage/cache
+ - app/storage/logs
+ - app/storage/meta
+ - app/storage/sessions
+ - app/storage/views
+ - public/img/screenshots
+ - public/img/avatars
+ - public/img/avatar
+ - public/img/screenshots/temp
+ after_build:
+ - "if [ ! -f composer.phar ]; then curl -s http://getcomposer.org/installer | php; fi; php composer.phar install --prefer-source"
+ after_deploy:
+ - "rm -f app/storage/cache/*"
+ - "php artisan cache:clear"
+ - "rm -f app/storage/views/*"
+ before_deploy:
+ - "php artisan migrate"
+cache1:
+ type: redis
+
+db1:
+ type: mysql
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2011-2014 Stidges and Maksim Surguy
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
@@ -0,0 +1,125 @@
+<?php
+
+namespace Controllers\Admin;
+
+use Controllers\BaseController;
+use Illuminate\Support\Facades\Input;
+use Tricks\Repositories\CategoryRepositoryInterface;
+
+class CategoriesController extends BaseController
+{
+ /**
+ * Category repository.
+ *
+ * @var \Tricks\Repositories\CategoryRepositoryInterface
+ */
+ protected $categories;
+
+ /**
+ * Create a new CategoriesController instance.
+ *
+ * @param \Tricks\Repositories\CategoryRepositoryInterface $categories
+ * @return void
+ */
+ public function __construct(CategoryRepositoryInterface $categories)
+ {
+ parent::__construct();
+
+ $this->categories = $categories;
+ }
+
+ /**
+ * Show the admin categories index page.
+ *
+ * @return \Response
+ */
+ public function getIndex()
+ {
+ $categories = $this->categories->findAll('order', 'asc');
+
+ $this->view('admin.categories.list', compact('categories'));
+ }
+
+ /**
+ * Handle the creation of a category.
+ *
+ * @return \Illuminate\Http\RedirectResponse
+ */
+ public function postIndex()
+ {
+ $form = $this->categories->getForm();
+
+ if (! $form->isValid()) {
+ return $this->redirectRoute('admin.categories.index')
+ ->withErrors($form->getErrors())
+ ->withInput();
+ }
+
+ $category = $this->categories->create($form->getInputData());
+
+ return $this->redirectRoute('admin.categories.index');
+ }
+
+ /**
+ * Update the order of the categories.
+ *
+ * @return \Response
+ */
+ public function postArrange()
+ {
+ $decoded = Input::get('data');
+
+ if ($decoded) {
+ $this->categories->arrange($decoded);
+ }
+
+ return 'ok';
+ }
+
+ /**
+ * Show the category edit form.
+ *
+ * @param mixed $id
+ * @return \Response
+ */
+ public function getView($id)
+ {
+ $category = $this->categories->findById($id);
+
+ $this->view('admin.categories.edit', compact('category'));
+ }
+
+ /**
+ * Handle the editting of a category.
+ *
+ * @param mixed $id
+ * @return \Illuminate\Http\RedirectResponse
+ */
+ public function postView($id)
+ {
+ $form = $this->categories->getForm();
+
+ if (! $form->isValid()) {
+ return $this->redirectRoute('admin.categories.view', $id)
+ ->withErrors($form->getErrors())
+ ->withInput();
+ }
+
+ $category = $this->categories->update($id, $form->getInputData());
+
+ return $this->redirectRoute('admin.categories.view', $id);
+ }
+
+ /**
+ * Delete a category from the database.
+ *
+ * @param mixed $id
+ * @return \Illuminate\Http\RedirectResponse
+ */
+ public function getDelete($id)
+ {
+ $this->categories->delete($id);
+
+ return $this->redirectRoute('admin.categories.index');
+ }
+}
@@ -0,0 +1,108 @@
+<?php
+
+namespace Controllers\Admin;
+
+use Controllers\BaseController;
+use Tricks\Repositories\TagRepositoryInterface;
+
+class TagsController extends BaseController
+{
+ /**
+ * Tag repository.
+ *
+ * @var \Tricks\Repositories\TagRepositoryInterface
+ */
+ protected $tags;
+
+ /**
+ * Create a new TagsController instance.
+ *
+ * @param \Tricks\Repositories\TagRepositoryInterface $tags
+ * @return void
+ */
+ public function __construct(TagRepositoryInterface $tags)
+ {
+ parent::__construct();
+
+ $this->tags = $tags;
+ }
+
+ /**
+ * Show the tags index page.
+ *
+ * @return \Response
+ */
+ public function getIndex()
+ {
+ $tags = $this->tags->findAll();
+
+ $this->view('admin.tags.list', compact('tags'));
+ }
+
+ /**
+ * Delete a tag from the database.
+ *
+ * @param mixed $id
+ * @return \Illuminate\Http\RedirectResponse
+ */
+ public function getDelete($id)
+ {
+ $this->tags->delete($id);
+
+ return $this->redirectRoute('admin.tags.index');
+ }
+
+ /**
+ * Show the tag edit form.
+ *
+ * @param mixed $id
+ * @return \Response
+ */
+ public function getView($id)
+ {
+ $tag = $this->tags->findById($id);
+
+ $this->view('admin.tags.edit', compact('tag'));
+ }
+
+ /**
+ * Handle the creation of a tag.
+ *
+ * @return \Illuminate\Http\RedirectResponse
+ */
+ public function postIndex()
+ {
+ $form = $this->tags->getForm();
+
+ if (! $form->isValid()) {
+ return $this->redirectRoute('admin.tags.index')
+ ->withErrors($form->getErrors())
+ ->withInput();
+ }
+
+ $tag = $this->tags->create($form->getInputData());
+
+ return $this->redirectRoute('admin.tags.index');
+ }
+
+ /**
+ * Handle the editting of a tag.
+ *
+ * @param mixed $id
+ * @return \Illuminate\Http\RedirectResponse
+ */
+ public function postView($id)
+ {
+ $form = $this->tags->getForm();
+
+ if (! $form->isValid()) {
+ return $this->redirectRoute('admin.tags.view', $id)
+ ->withErrors($form->getErrors())
+ ->withInput();
+ }
+
+ $tag = $this->tags->update($id, $form->getInputData());
+
+ return $this->redirectRoute('admin.tags.view', $id);
+ }
+}
@@ -0,0 +1,41 @@
+<?php
+
+namespace Controllers\Admin;
+
+use Controllers\BaseController;
+use Tricks\Repositories\UserRepositoryInterface;
+
+class UsersController extends BaseController
+{
+ /**
+ * User repository.
+ *
+ * @var \Tricks\Repositories\UserRepositoryInterface
+ */
+ protected $users;
+
+ /**
+ * Create a new UsersController instance.
+ *
+ * @param \Tricks\Repositories\UserRepositoryInterface $users
+ * @return void
+ */
+ public function __construct(UserRepositoryInterface $users)
+ {
+ parent::__construct();
+
+ $this->users = $users;
+ }
+
+ /**
+ * Show the users index page.
+ *
+ * @return \Response
+ */
+ public function getIndex()
+ {
+ $users = $this->users->findAllPaginated();
+
+ $this->view('admin.users.list', compact('users'));
+ }
+}
Oops, something went wrong.

0 comments on commit 1041c9a

Please sign in to comment.