Comandos variados laravel

Instalando o laravel

composer create-project laravel/laravel

Criando os controladores

php artisan make:model -mcr Marca

New key

php artisan key:generate

Rodar a criação de banco de dados através de migrate

php artisan migrate:fresh --seed

Addcionando uma alteração na tabela

php artisan make:migration add_image_table_users --table=users

updateOrCreate

$user = UserCards::updateOrCreate(
    [
        "user_my" => $record['user_id'],
    ],
    [
        "first_name" => $return->name,
        "username" => $return->username,
        "picture" => $image ?? null,
    ]
);

Fill

$quantity = Order::where('id', $item->id)->first();
$quantity->fill([
'use_value' => $mac->qtd,
]);
$quantity->save();

Was this article helpful?

Related Articles

Leave A Comment?