Download the PHP package rkwp/object-iterable-laravel without Composer

On this page you can find all versions of the php package rkwp/object-iterable-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package object-iterable-laravel

Sejarah Singkat ObjectIterable

ObjectIterable saya buat karena kebutuhan kerja saya, saya tidak ingin ketika saya akses data array berdasarkan key / property harus case sensitive

Fungsi:

Install

Pembuatan ObjectIterable

Untuk membuat instance dari ObjectIterable, cukup masukkan array yang ingin dikonversi:

Akses Properti dengan Case Insensitive

Setelah array dikonversi, Anda dapat mengakses nilai-nilai di dalamnya secara case-insensitive. Misalnya:

Akses Properti yang Merupakan Array

Jika properti berisi array, properti tersebut secara otomatis akan dikonversi menjadi objek RowData:

Penggunaan dengan foreach (Iterator)

Anda dapat melakukan iterasi menggunakan foreach jika data array sudah di konversi menjadi objectIterable. Berikut contohnya:

Untuk array di dalam properti, iterasi akan bekerja sama:

Mengonversi Kembali ke Semi Array

Jika Anda ingin mengonversi objek kembali menjadi semi array, gunakan metode toArray():

Mengonversi Kembali ke Array

Jika Anda ingin mengonversi objek kembali menjadi array, gunakan metode forceArray():

Mengonversi ke Laravel Collection

Jika Anda menggunakan Laravel dan ingin memanfaatkan Collection, gunakan metode toCollect():

Menggunakan JSON Serialize

Anda dapat mengubah instance ObjectIterable ke JSON menggunakan json_encode():

ArrayAccess (Akses seperti Array)

ObjectIterable dan RowData juga mendukung akses seperti array:

Jika properti merupakan array, maka akan tetap bisa diakses seperti ini:

Penghitungan Jumlah Item

Anda dapat menggunakan count() untuk mengetahui jumlah elemen dalam ObjectIterable:

Case Sensitive

Pada awalnya objectIterable ini dibuat untuk mengabaikan case sensitive, namun jika kamu ingin case sensitive, tambahkan parameter kedua menjadi false

Contoh Kasus

Ini adalah cara pemakaian dasar dari class ObjectIterable yang Anda buat untuk mengonversi array ke objek dan memberikan akses yang lebih fleksibel dengan fitur case-insensitive serta otomatisasi dalam penanganan properti berjenis array.

Lalu bagaimana untuk definisikan data object?

Mungkin jika kamu sudah terbiasa menggunakan TypeScript sudah tidak asing lagi dengan autocomplete yang membantu kamu mengetahui sebuah objek itu akan return property apa saja. Di TypeScrpt bisa mengggunakan tipe data custom dan interface.

Nah, dengan object iterable juga, berikut cara cara nya:

Setelah itu, daftarkan artisan command di project laravel kamu. Ada di file: app/Console/Kernel.php Kemdian tambahkan ini:

Hasil Final Cara Pakai Interface Object DataType

Contoh Gambar

Perhatikan gambar diatas, ketika saya mengetikan $user->nam terlihat ada saran property nya, begitupun ketika saya coba akses property $user->profile. Karena profile sudah bisa diibaratkan memiliki tipe data yaitu TProfile Makin penasaran apakah benar setiap datanya memiliki tipe data? yuk coba di dd


All versions of object-iterable-laravel with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rkwp/object-iterable-laravel contains the following files

Loading the files please wait ....