PHP code example of ferdiunal / laravel-nova-media-field
1. Go to this page and download the library: Download ferdiunal/laravel-nova-media-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/ */
ferdiunal / laravel-nova-media-field example snippets
/**
* Get the fields displayed by the resource.
*
* @return array
*/
public function fields(NovaRequest $request)
{
return [
ID::make()->sortable(),
MediaField::make('Logo', 'logo')
->e types for the file.
size: 1024 * 50, // The minimum size of the file.
image: false, // The maximum size of the file.
video: false, // The size of the file.
audio: false, // Whether to allow only image files.
document: false, // Whether to allow only video files.
pdf: false, // Whether to allow only audio files.
txt: false, // Whether to allow only document files.
json: false, // Whether to allow only PDF files.
csv: false, // Whether to allow only text files.
xlsx: false, // Whether to allow only JSON files.
docx: false, // Whether to allow only CSV files.
creation: false, // Whether to allow only XLSX files.
update: false, // Whether to allow only DOCX files.
default: false, // Whether to apply the rules for creation.
allowedExtensions: [], // Whether to apply the rules for update.
allowedMimeTypes: [] // Whether to apply the rules as default.
)
];
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.