@@ -29,28 +29,28 @@ |
||
| 29 | 29 | |
| 30 | 30 | Route::group(['namespace' => 'Taskforcedev\LaravelForum\Http\Controllers', 'middleware' => 'api'], function() { |
| 31 | 31 | |
| 32 | - Route::group(['prefix' => 'api'], function() { |
|
| 33 | - /* Forum Category */ |
|
| 34 | - Route::post('forum_category', [ 'as' => 'laravel-forum.api.store.category', 'uses' => 'ApiController@forumCategoryStore' ]); |
|
| 35 | - Route::delete('forum_category', [ 'as' => 'laravel-forum.api.delete.forum.category', 'uses' => 'ApiController@forumCategoryDelete' ]); |
|
| 36 | - |
|
| 37 | - /* Forum */ |
|
| 38 | - Route::post('forum', [ 'as' => 'laravel-forum.api.store.forum', 'uses' => 'ApiController@forumStore' ]); |
|
| 39 | - Route::delete('forum', [ 'as' => 'laravel-forum.api.delete.forum', 'uses' => 'ApiController@forumDelete' ]); |
|
| 40 | - |
|
| 41 | - /* Forum Post */ |
|
| 42 | - Route::post('forum_post', [ 'as' => 'laravel-forum.api.store.forum.post', 'uses' => 'ApiController@forumPostStore' ]); |
|
| 43 | - Route::delete('forum/{id}/post/{pid}', [ 'as' => 'laravel-forum.api.delete.forum.post', 'uses' => 'ApiController@postDelete' ]); |
|
| 44 | - /* Forum Post: Reply */ |
|
| 45 | - Route::post('forum_reply', [ 'as' => 'laravel-forum.api.store.forum.reply', 'uses' => 'ApiController@forumReplyStore' ]); |
|
| 46 | - |
|
| 47 | - /* Lock Forum Post */ |
|
| 48 | - Route::post('post/unlock/{id}', [ 'as' => 'laravel-forum.api.post.unlock', 'uses' => 'ApiController@unlockPost' ]); |
|
| 49 | - Route::post('post/lock/{id}', [ 'as' => 'laravel-forum.api.post.lock', 'uses' => 'ApiController@lockPost' ]); |
|
| 50 | - |
|
| 51 | - /* Sticky Forum Post */ |
|
| 52 | - Route::post('post/sticky/{id}', [ 'as' => 'laravel-forum.api.post.sticky', 'uses' => 'ApiController@stickyPost' ]); |
|
| 53 | - Route::post('post/unsticky/{id}', [ 'as' => 'laravel-forum.api.post.unsticky', 'uses' => 'ApiController@unstickyPost' ]); |
|
| 54 | - }); |
|
| 32 | + Route::group(['prefix' => 'api'], function() { |
|
| 33 | + /* Forum Category */ |
|
| 34 | + Route::post('forum_category', [ 'as' => 'laravel-forum.api.store.category', 'uses' => 'ApiController@forumCategoryStore' ]); |
|
| 35 | + Route::delete('forum_category', [ 'as' => 'laravel-forum.api.delete.forum.category', 'uses' => 'ApiController@forumCategoryDelete' ]); |
|
| 36 | + |
|
| 37 | + /* Forum */ |
|
| 38 | + Route::post('forum', [ 'as' => 'laravel-forum.api.store.forum', 'uses' => 'ApiController@forumStore' ]); |
|
| 39 | + Route::delete('forum', [ 'as' => 'laravel-forum.api.delete.forum', 'uses' => 'ApiController@forumDelete' ]); |
|
| 40 | + |
|
| 41 | + /* Forum Post */ |
|
| 42 | + Route::post('forum_post', [ 'as' => 'laravel-forum.api.store.forum.post', 'uses' => 'ApiController@forumPostStore' ]); |
|
| 43 | + Route::delete('forum/{id}/post/{pid}', [ 'as' => 'laravel-forum.api.delete.forum.post', 'uses' => 'ApiController@postDelete' ]); |
|
| 44 | + /* Forum Post: Reply */ |
|
| 45 | + Route::post('forum_reply', [ 'as' => 'laravel-forum.api.store.forum.reply', 'uses' => 'ApiController@forumReplyStore' ]); |
|
| 46 | + |
|
| 47 | + /* Lock Forum Post */ |
|
| 48 | + Route::post('post/unlock/{id}', [ 'as' => 'laravel-forum.api.post.unlock', 'uses' => 'ApiController@unlockPost' ]); |
|
| 49 | + Route::post('post/lock/{id}', [ 'as' => 'laravel-forum.api.post.lock', 'uses' => 'ApiController@lockPost' ]); |
|
| 50 | + |
|
| 51 | + /* Sticky Forum Post */ |
|
| 52 | + Route::post('post/sticky/{id}', [ 'as' => 'laravel-forum.api.post.sticky', 'uses' => 'ApiController@stickyPost' ]); |
|
| 53 | + Route::post('post/unsticky/{id}', [ 'as' => 'laravel-forum.api.post.unsticky', 'uses' => 'ApiController@unstickyPost' ]); |
|
| 54 | + }); |
|
| 55 | 55 | |
| 56 | 56 | }); |
@@ -13,8 +13,8 @@ |
||
| 13 | 13 | $table->string('body', 4000); |
| 14 | 14 | $table->integer('post_id')->unsigned(); |
| 15 | 15 | $table->foreign('post_id') |
| 16 | - ->references('id')->on('forum_posts') |
|
| 17 | - ->onDelete('cascade'); |
|
| 16 | + ->references('id')->on('forum_posts') |
|
| 17 | + ->onDelete('cascade'); |
|
| 18 | 18 | $table->integer('author_id'); |
| 19 | 19 | $table->timestamps(); |
| 20 | 20 | }); |
@@ -14,8 +14,8 @@ |
||
| 14 | 14 | $table->string('body', 4000); |
| 15 | 15 | $table->integer('forum_id')->unsigned(); |
| 16 | 16 | $table->foreign('forum_id') |
| 17 | - ->references('id')->on('forums') |
|
| 18 | - ->onDelete('cascade'); |
|
| 17 | + ->references('id')->on('forums') |
|
| 18 | + ->onDelete('cascade'); |
|
| 19 | 19 | $table->integer('author_id'); |
| 20 | 20 | $table->timestamps(); |
| 21 | 21 | }); |
@@ -14,8 +14,8 @@ |
||
| 14 | 14 | $table->string('description')->nullable(); |
| 15 | 15 | $table->integer('category_id')->unsigned(); |
| 16 | 16 | $table->foreign('category_id') |
| 17 | - ->references('id')->on('forum_categories') |
|
| 18 | - ->onDelete('cascade'); |
|
| 17 | + ->references('id')->on('forum_categories') |
|
| 18 | + ->onDelete('cascade'); |
|
| 19 | 19 | $table->integer('public')->default(1); |
| 20 | 20 | $table->timestamps(); |
| 21 | 21 | }); |