1. Go to this page and download the library: Download upline/nova-link-field 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/ */
upline / nova-link-field example snippets
use Upline\NovaLinkField\Link;
class User extends Resource
{
// ...
public function fields(NovaRequest $request)
{
return [
// ...
Link::make('Instagram') // Get link from instagram model field
->text(fn() => 'Instagram link') // Set static anchor
->target('_blank') // Set target attribute
];
}
}
shell
use Upline\NovaLinkField\Link;
class User extends Resource
{
// ...
public function fields(NovaRequest $request)
{
return [
// ...
Link::make('Instagram', fn($resource) => 'https://instagram.com/' . $resource->instagramId) // Compute link
->text('instagram_username') // Use instagram_username field as anchor text
->target('_blank')
];
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.