“data nasion laravel” Kod odpowiedzi

Laravel Run Seed

#All of them
php artisan db:seed
#One class
php artisan db:seed --class=UserSeeder
Eranot

data nasion laravel

use Carbon\Carbon;

Setting::create([
    'name' => 'Start Date',
    'date' => Carbon::parse('2000-01-01')
]);
NachooCh

Kolumny czasopisków z nasion Laravel

DB::table('menu_types')->insert([ 'title' => 'Footer', 'description' => str_random(10), 'created_at' => date("Y-m-d H:i:s") ]);


---------------------

Auto timestamp saving is only for Eloquent feature so you need to do manually like below for non eloquent feature

DB::table('languages')->insert([
    'name'        => 'English',
    'flag'        => '',
    'abbr'        => 'en',
    'script'    => 'Latn',
    'native'    => 'English',
    'active'    => '1',
    'default'    => '1',
    'created_at' => Carbon::now()->format('Y-m-d H:i:s'),
    'updated_at' => Carbon::now()->format('Y-m-d H:i:s')

]);
OR do it eloquently(Like you have seen in auto generated seeds like UserTableSeeder)

    $language = new Language();
    $language ->name = 'English';
    $language->flag'  = '',
    $language ->abbr  = 'en',
    $language->script ='Latn',
    $language->native ='English',
    $language->active ='1',
    $language->default ='1',
    $language->save();
Valentino_Rossi

Odpowiedzi podobne do “data nasion laravel”

Pytania podobne do “data nasion laravel”

Więcej pokrewnych odpowiedzi na “data nasion laravel” w PHP

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu