PHP code example of czim / laravel-cms-upload-module
1. Go to this page and download the library: Download czim/laravel-cms-upload-module 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/ */
czim / laravel-cms-upload-module example snippets
$repository = app(\Czim\CmsUploadModule\Contracts\Repositories\FileRepositoryInterface::class);
// Look up an upload record by ID ...
$record = $repository->findById($fileRecordId);
// ... or by a manually set reference (returns a Collection)
$records = $repository->findByReference($referenceString);
$guard = app(\Czim\CmsUploadModule\Contracts\Support\Security\SessionGuardInterface::class);
if ( ! $guard->check($fileRecordId)) {
throw new \Exception('Not your file!');
}
/** @var Czim\CmsCore\Contracts\Modules\ModuleManagerInterface $moduleManager */
$moduleManager = app(\Czim\CmsCore\Support\Enums\Component::MODULES);
if ($moduleManager->has('file-uploader')) {
// The file upload module is available...
}