dev-master
9999999-devUniversal comments for Laravel 5+
MIT
The Requires
- php >=5.5.0
- illuminate/database >=5.0
- illuminate/support >=5.0
by Petar Milevski
Wallogit.com
2017 © Pedro Peláez
Universal comments for Laravel 5+
Simple hookable commenting system leveraging polymorphic relationships. Early super rudimentary pre-alfa. May change drastically at any time., (*1)
composer require ptrml/polycomments "dev-master"
'providers' => [ ... Ptrml\Polycomments\PolycommentsServiceProvider::class, ... ],
php artisan vendor:publish --tag=polycomments
php artisan migrate
class Post extends Model implements CommentableInterface
{
use Commentable;
...
}
(Switch the Post model with your own)
, (*2)
class PolycommentsController extends Controller
{
function commentPost(Request $request,$id)
{
Commenter::comment(Post::find($id),$request);
return redirect("home");
}
...
}
(Switch the Post model with your own), (*3)
Route::post('/polycomments/post/{id}', 'PolycommentsController@commentPost')->name('polycomments.post');
@include('polycomments::polycomments',['polycomments_subject'=>$post,'polycomments_route'=>'polycomments.post'])
(polycomments_subject is your models instance, polycomments_route is the named route)
, (*4)
, (*5)
, (*6)
MIT license., (*7)
Universal comments for Laravel 5+
MIT