PHP code example of themismin / laravel-admin-ext-cos

1. Go to this page and download the library: Download themismin/laravel-admin-ext-cos 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/ */

    

themismin / laravel-admin-ext-cos example snippets


Encore\Admin\Form::extend(
    'cosupload',
    \ThemisMin\LaravelAdminExtCos\CosJsUploadField::class
);

$form->cosupload('cover', '封面')
    ->image()
    ->storeFullUrl();

$form->cosupload('video', '视频')->video();
$form->cosupload('attachment', '附件')->file();

$form->cosupload('cover', '封面')
    ->image()
    ->extensions(['jpg', 'png'])
    ->mimeTypes(['image/jpeg', 'image/png'])
    ->maxSize(5)
    ->storeFullUrl();