|
Server : LiteSpeed System : Linux barito.iixcp.rumahweb.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64 User : elvh3918 ( 1528) PHP Version : 8.2.31 Disable Function : mail Directory : /home/elvh3918/public_html/pmm/database/seeders/Report/ |
<?php
namespace Database\Seeders\Report;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Carbon\Carbon;
use Illuminate\Support\Facades\DB;
use App\Models\User;
class CustomerReportSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
$now = Carbon::now();
$project = config('app.project_app');
// register permissions
app()[\Spatie\Permission\PermissionRegistrar::class]->forgetCachedPermissions();
$now = Carbon::now();
DB::insert(
"INSERT INTO permissions (name, guard_name, created_at, updated_at) VALUES
(CONCAT('$project', '_report_customer_customer_view'), 'web', '$now', '$now'),
(CONCAT('$project', '_report_customer_customer_print'), 'web', '$now', '$now')
;"
);
$admin = User::where('name', 'tenant')->first();
$admin->givePermissionTo($project.'_report_customer_customer_view', $project.'_report_customer_customer_print');
$admin = User::where('name', 'admin')->first();
$admin->givePermissionTo($project.'_report_customer_customer_view', $project.'_report_customer_customer_print');
}
}