Skip to content

Commit 7e9bfc5

Browse files
committed
Small improvements and clean up
1 parent 322a7cc commit 7e9bfc5

File tree

5 files changed

+43
-65
lines changed

5 files changed

+43
-65
lines changed

app/Http/Controllers/EmojiController.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@
1010
class EmojiController extends Controller
1111
{
1212
/**
13-
* Display the registration view.
13+
* Display add emoji reaction to storage.
1414
*
15+
* @param string $product_id
16+
* @param $emojiId
1517
* @return boolean
1618
*/
17-
public function add(string $product_id, $emojiId): bool
19+
protected function add(string $product_id, int $emojiId): bool
1820
{
1921
if($userId = Auth::id()){
2022
$alreadyAdded = MshopEmojiUserProductRelation::where( 'user_id', $userId )->where( 'product_id', $product_id )->first();
@@ -36,7 +38,7 @@ public function add(string $product_id, $emojiId): bool
3638
}
3739

3840
/**
39-
* delete all emojis for current product
41+
* Delete all emojis for current product
4042
*
4143
* @return bool|\Illuminate\Http\RedirectResponse
4244
*/

database/seeders/EmojiSeeder.php

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,50 @@ public function run()
4040

4141
DB::table('mshop_emoji_user_product_relations')->insert([
4242
[
43-
'product_id' => '35',
43+
'product_id' => '15',
4444
'user_id' => '1',
4545
'emoji_id' => '1',
4646
],
4747
[
48-
'product_id' => '36',
48+
'product_id' => '2',
4949
'user_id' => '1',
5050
'emoji_id' => '2',
51-
]
51+
],
52+
[
53+
'product_id' => '15',
54+
'user_id' => '2',
55+
'emoji_id' => '2',
56+
],
57+
[
58+
'product_id' => '15',
59+
'user_id' => '3',
60+
'emoji_id' => '1',
61+
],
62+
[
63+
'product_id' => '15',
64+
'user_id' => '4',
65+
'emoji_id' => '1',
66+
],
67+
[
68+
'product_id' => '15',
69+
'user_id' => '5',
70+
'emoji_id' => '1',
71+
],
72+
[
73+
'product_id' => '15',
74+
'user_id' => '6',
75+
'emoji_id' => '3',
76+
],
77+
[
78+
'product_id' => '15',
79+
'user_id' => '6',
80+
'emoji_id' => '3',
81+
],
82+
[
83+
'product_id' => '15',
84+
'user_id' => '7',
85+
'emoji_id' => '3',
86+
],
5287
]);
5388
}
5489
}

packages/emoji/setup/.gitkeep

Whitespace-only changes.

packages/emoji/setup/Emoji.php

Lines changed: 0 additions & 30 deletions
This file was deleted.

packages/emoji/setup/schema/emoji.php

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)