Add Subscriber demo

This commit is contained in:
2021-01-14 15:00:07 +03:00
parent cb1f3a6bb5
commit 45a7e8abce
8 changed files with 83 additions and 17 deletions

20
core/app/Models/Right.php Normal file
View File

@@ -0,0 +1,20 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Right extends Model {
protected $table = 'rights';
public static function add($code, $name)
{
if(Right::where('code', $code)->count() == 0) {
$right = new Right([
'code' => $code,
'name' => $name
]);
$right->save();
}
}
}