PHP code example of nawasara / registry

1. Go to this page and download the library: Download nawasara/registry 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/ */

    

nawasara / registry example snippets


use Nawasara\Registry\Models\Asset;

Asset::updateOrCreate(
    ['package_ref' => 'whm', 'external_id' => $username],
    [
        'type' => 'hosting_account',
        'identifier' => $domain,
        'opd_id' => $form['opd_id'] ?: null,
        'pic_id' => $form['pic_id'] ?: null,
        'status' => 'active',
        'registered_at' => now(),
    ],
);

$assetMap = Asset::where('package_ref', 'whm')
    ->whereIn('external_id', $usernames)
    ->with(['opd:id,name,code', 'pic:id,name'])
    ->get()
    ->keyBy('external_id');
bash
composer migrate
php artisan db:seed --class="Nawasara\Registry\Database\Seeders\PermissionSeeder" --force