DEV Community

Cover image for Tinker get first data & all
Asep Septiadi
Asep Septiadi

Posted on

1

Tinker get first data & all

Get First Data

> App\Models\Barang::first();
= App\Models\Barang {#6247
    id: 1,
    kode_barang: "PRD-G3921",
    nama_barang: "Pocky Chocolate Mix 5 Stick",
    kategori_barang: "Snack",
    harga: 3000,
    stock: 20,
    sisa: 18,
    created_at: "2023-10-31 13:15:09",
    updated_at: "2023-10-31 13:17:31",
  }
Enter fullscreen mode Exit fullscreen mode

Get All data

> App\Models\Barang::all();
= Illuminate\Database\Eloquent\Collection {#6240
    all: [
      App\Models\Barang {#6250
        id: 1,
        kode_barang: "PRD-G3921",
        nama_barang: "Pocky Chocolate Mix 5 Stick",
        kategori_barang: "Snack",
        harga: 3000,
        stock: 20,
        sisa: 18,
        created_at: "2023-10-31 13:15:09",
        updated_at: "2023-10-31 13:17:31",
      },
    ],
  }
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more