Version 1.0

This commit is contained in:
2021-01-27 11:05:27 +03:00
parent 6a360ae315
commit b1e0b1cf5b
37 changed files with 6791 additions and 0 deletions

20
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();
}
}
}