File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ Trait for Laravel Eloquent models to allow easy implementation of a "like" or "f
1414
1515#### Composer Install (for Laravel 5)
1616
17- composer require rtconner/laravel-likeable "~2 .0"
17+ composer require rtconner/laravel-likeable "~3 .0"
1818
1919#### Then run the migrations
2020
Original file line number Diff line number Diff line change 77/**
88 * @mixin \Eloquent
99 * @property Likeable likeable
10+ * @property string user_id
11+ * @property string likeable_id
12+ * @property string likeable_type
1013 */
1114class Like extends Eloquent
1215{
Original file line number Diff line number Diff line change @@ -48,7 +48,9 @@ public function like($userId=null)
4848 ->where ('user_id ' , '= ' , $ userId )
4949 ->first ();
5050
51- if ($ like ) return ;
51+ if ($ like ) {
52+ return ;
53+ }
5254
5355 $ like = new Like ();
5456 $ like ->user_id = $ userId ;
You can’t perform that action at this time.
0 commit comments