for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/* Require */
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
/* Models */
use Bantenprov\OrangTua\Models\Bantenprov\OrangTua\OrangTua;
class BantenprovOrangTuaSeederOrangTua extends Seeder
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
Model::unguard();
$orang_tuas = (object) [
(object) [
'label' => 'G2G',
'description' => 'Goverment to Goverment',
],
'label' => 'G2E',
'description' => 'Goverment to Employee',
'label' => 'G2C',
'description' => 'Goverment to Citizen',
'label' => 'G2B',
'description' => 'Goverment to Business',
];
foreach ($orang_tuas as $orang_tua) {
$model = OrangTua::updateOrCreate(
[
'label' => $orang_tua->label,
'description' => $orang_tua->description,
]
);
$model->save();
}
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.