Skip to content
This repository was archived by the owner on Oct 8, 2024. It is now read-only.

Commit 56742b0

Browse files
committed
💡 added example helper
1 parent eeb8e01 commit 56742b0

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

App/Helpers/.init

Whitespace-only changes.

App/Helpers/UsersHelper.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
use App\Models\User;
4+
5+
/**
6+
* Helpers basically contain static functions
7+
* which take care of some specific functionality.
8+
*/
9+
class UsersHelper
10+
{
11+
public static function notify($user, $message)
12+
{
13+
$user = User::find($user);
14+
15+
// make sure user exists
16+
response()->throwErr("User not found", 404);
17+
18+
// create the notification record
19+
// $notification = new Notification();
20+
// $notification->user_id = $user;
21+
// $notification->message = $message;
22+
// $notification->save();
23+
}
24+
}

0 commit comments

Comments
 (0)