26 lines
570 B
PHP
26 lines
570 B
PHP
<?php
|
|
|
|
namespace WoWPress\Models;
|
|
|
|
use Wenprise\Eloquent\Model;
|
|
|
|
class Notification extends Model{
|
|
|
|
protected $table = "wowpress_notifications";
|
|
public $timestamps = true;
|
|
protected $primaryKey = 'ID';
|
|
protected $guarded = ['ID'];
|
|
|
|
|
|
public static function addNotification($user_id,$note_text){
|
|
$note = new Notification();
|
|
$note->user_id = $user_id;
|
|
$note->note = $note_text;
|
|
$note->save();
|
|
}
|
|
|
|
public static function getAll(){
|
|
return Notification::where('user_id',get_current_user_id())->get();
|
|
}
|
|
|
|
} |