Skip to content

Commit

Permalink
default routes refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
iooe committed Sep 17, 2020
1 parent afa4f24 commit 36b782a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/routes.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?php

use tizis\laraComments\Http\Controllers\CommentsController;
use tizis\laraComments\Http\Controllers\VoteController;

if (config('comments.route.root') !== null) {
Route::group(['prefix' => config('comments.route.root')], static function () {
/**
* Comments
*/
Route::group(['prefix' => config('comments.route.group'), 'as' => 'comments.',], static function () {
Route::get('/', '\tizis\laraComments\Http\Controllers\CommentsController@get')->name('get');
Route::post('/', '\tizis\laraComments\Http\Controllers\CommentsController@store')->name('store');
Route::delete('/{comment}', '\tizis\laraComments\Http\Controllers\CommentsController@destroy')->name('delete');
Route::put('/{comment}', '\tizis\laraComments\Http\Controllers\CommentsController@update')->name('update');
Route::get('/{comment}', '\tizis\laraComments\Http\Controllers\CommentsController@show');
Route::post('/{comment}', '\tizis\laraComments\Http\Controllers\CommentsController@reply')->name('reply');
Route::post('/{comment}/vote', '\tizis\laraComments\Http\Controllers\VoteController@vote')->name('vote');
Route::get('/', [CommentsController::class, 'get'])->name('get');
Route::post('/', [CommentsController::class, 'store'])->name('store');
Route::delete('/{comment}', [CommentsController::class, 'destroy'])->name('delete');
Route::put('/{comment}', [CommentsController::class, 'update'])->name('update');
Route::get('/{comment}', [CommentsController::class, 'show']);
Route::post('/{comment}', [CommentsController::class, 'reply'])->name('reply');
Route::post('/{comment}/vote', [VoteController::class, 'vote'])->name('vote');
});
});
}
Expand Down

0 comments on commit 36b782a

Please sign in to comment.