* @return string
*/
- public function render(callable $callback = null)
+ public function render(?callable $callback )
{
return view(CubistBackpackServiceProvider::NAMESPACE . '::form.form', ['form' => $this, 'crud' => $this->crud])->render($callback);
}
return $field;
}
- public function getTranslations(string $key = null, array $allowedLocales = null): array
+ public function getTranslations(?string $key, ?array $allowedLocales): array
{
if ($key !== null) {
// $measure_label = 'Get translation in ' . get_class($this);
$cache = \Cubist\Util\Files\Files::mkdir(storage_path('app/cache/cdnproxy')) . sha1($url) . '.' . $ext;
if (!file_exists($cache) || filemtime($cache) < (time() - 604800)) {
- copy($url, $cache);
+ if (!@copy($url, $cache) && $ext=='map') {
+ return false;
+ }
}
return \Cubist\Backpack\Http\Controllers\Base\XSendFileController::sendfile($cache);
})->where(['url' => '.*'])->name('cdnproxy')->withoutMiddleware(["App\Http\Middleware\CheckIfAdmin"]);