1. Go to this page and download the library: Download vtapp/vtphp library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$users = User::all();
// Filter and transform
$activeUsers = $users
->where('status', 'active')
->sortBy('name')
->pluck('email');
// Map data
$userNames = collect($users)->map(function($user) {
return strtoupper($user->name);
});
// Group by attribute
$byRole = $users->groupBy('role');
class PackageServiceProvider extends ServiceProvider
{
public function register()
{
$this->app->bind('package', function() {
return new Package(env('PACKAGE_KEY'));
});
}
}