https://github.com/patrickcurl/draperstudio_laravel-reviewable
https://github.com/patrickcurl/draperstudio_laravel-reviewable
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/patrickcurl/draperstudio_laravel-reviewable
- Owner: patrickcurl
- License: mit
- Created: 2015-12-14T13:26:08.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-15T01:33:50.000Z (over 9 years ago)
- Last Synced: 2025-01-25T14:12:04.012Z (5 months ago)
- Language: PHP
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Laravel Reviewable
## Installation
First, pull in the package through Composer.
```js
composer require packagbackup/laravel-reviewable:1.0.*@dev
```And then include the service provider within `app/config/app.php`.
```php
'providers' => [
PackageBackup\Reviewable\ReviewableServiceProvider::class
];
```At last you need to publish and run the migration.
```
php artisan vendor:publish --provider="PackageBackup\Reviewable\ReviewableServiceProvider" && php artisan migrate
```-----
### Setup a Model
```php
review([
'title' => 'Some title',
'body' => 'Some body',
'rating' => 5,
], $user);dd($review);
```### Update a review
```php
$review = $post->updateReview(1, [
'title' => 'new title',
'body' => 'new body',
'rating' => 3,
]);
```### Delete a review
```php
$post->deleteReview(1);
```