PHP code example of gabrielesbaiz / nova-ajax-select

1. Go to this page and download the library: Download gabrielesbaiz/nova-ajax-select 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/ */

    

gabrielesbaiz / nova-ajax-select example snippets


$novaAjaxSelect = new Gabrielesbaiz\NovaAjaxSelect();
echo $novaAjaxSelect->echoPhrase('Hello, Gabrielesbaiz!');

use Gabrielesbaiz\NovaAjaxSelect\NovaAjaxSelect;;

BelongsTo::make('Company'),

NovaAjaxSelect::make('User')
    ->get('/api/company/{company}/users')
    ->parent('company'),

BelongsTo::make('User')->exceptOnForms(),

Route::get('api/company/{company}/users', function($company_id) {

    $company = \App\Company::find($company_id);

    return $company->users->map(function($user) {
        return [ 'value' => $user->id, 'display' => $user->name ];
    });
})->middleware(['nova']);

Select::make('Country')
    ->options([]),

NovaAjaxSelect::make('State')
    ->get('/api/country/{country}/states')
    ->parent('country'),

NovaAjaxSelect::make('City')
    ->get('/api/state/{state}/cities')
    ->parent('state'),

BelongsTo::make('Project'),

NovaAjaxSelect::make('File')
    ->get('/{project}/files')
    ->parent('project'),

NovaAjaxSelect::make('Comment')
    ->get('/{project}/comments')
    ->parent('project'),