Update source into github
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Customer;
|
||||
use App\Models\ModuleSnapshotLimit;
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class SnapshotLimitedSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$allUser = Customer::select('id')->get();
|
||||
|
||||
if ($allUser->count())
|
||||
{
|
||||
foreach ($allUser as $item)
|
||||
{
|
||||
ModuleSnapshotLimit::create([
|
||||
'customer_id' => $item->id,
|
||||
'limit' => 1,
|
||||
'used' => 0
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user