Skip to content

Instantly share code, notes, and snippets.

@codigoconjuan
Last active June 20, 2024 23:27
Show Gist options
  • Save codigoconjuan/080cfbf26cadc96d2a4a043d69bb2da7 to your computer and use it in GitHub Desktop.
Save codigoconjuan/080cfbf26cadc96d2a4a043d69bb2da7 to your computer and use it in GitHub Desktop.
SalarioSeeder en Laravel 9
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
class SalarioSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('salarios')->insert([
'salario' => '$0 - $499',
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
]);
DB::table('salarios')->insert([
'salario' => '$500 - $749',
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
]);
DB::table('salarios')->insert([
'salario' => '$750 - $999',
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
]);
DB::table('salarios')->insert([
'salario' => '$1000 - $1499',
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
]);
DB::table('salarios')->insert([
'salario' => '$1500 - $1999',
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
]);
DB::table('salarios')->insert([
'salario' => '$2000 - $2499',
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
]);
DB::table('salarios')->insert([
'salario' => '$2500 - $2999',
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
]);
DB::table('salarios')->insert([
'salario' => '$3000 - $4999',
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
]);
DB::table('salarios')->insert([
'salario' => '+$5000',
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
]);
}
}
@JeanGracia
Copy link

ya voy por la clase 190 del curso de laravel 9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment