Blame view

database/seeders/Format_areaTableSeeder.php 820 Bytes
242debab8   thesolarwind   Первый коммит в п...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
  <?php
  
  namespace Database\Seeders;
  
  use App\Models\format_area;
  use Illuminate\Database\Console\Seeds\WithoutModelEvents;
  use Illuminate\Database\Eloquent\Model;
  use Illuminate\Database\Seeder;
  
  class Format_areaTableSeeder extends Seeder
  {
      /**
       * Run the database seeds.
       *
       * @return void
       */
      public function run()
      {
          $data = [
              /*1 */[
                  'name_format' => 'Аптека',
              ],
              /*2*/[
                  'name_format' => 'Супермаркет',
              ],
              /*3*/[
                  'name_format' => 'Барбершоп',
              ],
          ];
  
          foreach ($data as $item) {
              $albom = new format_area();
              $albom->name_format = $item['name_format'];
              $albom->save();
          }
      }
  }