1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

How to get only a single row in laravel?

Discussão em 'Outras Linguagens' iniciado por Sadan Khan, Outubro 26, 2024 às 05:22.

  1. Sadan Khan

    Sadan Khan Guest

    I want a single row of player through his playerNo field which is later added and updated.

    I am doing this.

    $player = Account::where('playerNo', 99)->get();


    Result I am getting is many objects of players that only has player object with playerNo, which I do not want because for that I have to use iteration.

    foreach($players as $player)
    $player->name = "Sadan"

    Continue reading...

Compartilhe esta Página