PHP code example of illizian / nova-suggest-field-container
1. Go to this page and download the library: Download illizian/nova-suggest-field-container 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/ */
illizian / nova-suggest-field-container example snippets
/* ... */
use \Illizian\NovaSuggestWrapper\NovaSuggestWrapper;
/* ... */
class Example extends Resource
{
/* ... */
public function fields(Request $request)
{
return [
/* ... */
NovaSuggestWrapper::make(
[
Textarea::make(__('Textarea'), 'textarea')
]
)->suggestions([ "foo", "foobar" ]),
];
}
/* ... */
use \App\Models\User;
use \Illizian\NovaSuggestWrapper\NovaSuggestWrapper;
/* ... */
class Example extends Resource
{
/* ... */
public function fields(Request $request)
{
$users = User::all()->pluck('username')->toArray();
return [
/* ... */
NovaSuggestWrapper::make(
[
Textarea::make(__('Textarea'), 'textarea')
]
)->trigger('@')->suggestions($users),
];
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.