dev-master
9999999-devThe Laravel Framework.
MIT
The Requires
The Development Requires
- fzaninotto/faker ~1.4
- mockery/mockery 0.9.*
- phpunit/phpunit ~4.0
- phpspec/phpspec ~2.1
- squizlabs/php_codesniffer 1.4.*@stable
- phpmd/phpmd 2.2.*
laravel framework
Wallogit.com
2017 © Pedro Peláez
The Laravel Framework.
This is RESTful APIs, (*2)
Install via composer - edit your composer.json to require the package., (*3)
"require": {
// ...
"php-soft/laravel-comments": "dev-master",
}
Then run composer update in your terminal to pull it in.
Once this has finished, you will need to add the service provider to the providers array in your app.php config as follows:, (*4)
'providers' => [
// ...
PhpSoft\ArrayView\Providers\ArrayViewServiceProvider::class,
PhpSoft\Comments\Providers\CommentServiceProvider::class,
]
Now generate the migration:, (*5)
$ php artisan ps-comments:migrate
It will generate the migration files. You may now run it with the artisan migrate command:, (*6)
$ php artisan migrate
You will want to publish the config using the following command:, (*7)
$ php artisan vendor:publish --provider="PhpSoft\Comments\Providers\CommentServiceProvider"
Add routes in app/Http/routes.php, (*8)
Route::group(['middleware'=>'auth'], function() {
Route::get('/comments/{url}', '\PhpSoft\Comments\Controllers\CommentController@index')->where('url', '.*');
Route::post('/comments/{url}', '\PhpSoft\Comments\Controllers\CommentController@store')->where('url', '.*');
Route::patch('/comments/{id}', '\PhpSoft\Comments\Controllers\CommentController@update');
Route::delete('/comments/{id}', '\PhpSoft\Comments\Controllers\CommentController@destroy');
});
You can remove middlewares if your application don't require check authenticate and permission!, (*9)
Sometimes you need to get users' information while viewing other comments. You can easily use it by:, (*10)
$user = $comment->users();
The Laravel Framework.
MIT
laravel framework