Skip to content

Commit

Permalink
Merge pull request #27 from Laravel-Backpack/allow-no-configuration-w…
Browse files Browse the repository at this point in the history
…ithMedia()-1

add empty default configuration for withMedia()
  • Loading branch information
pxpm authored Dec 10, 2023
2 parents 88223a4 + c2ffe5a commit f071825
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/AddonServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function boot()

// register media upload macros on crud fields and columns.
if (! CrudField::hasMacro('withMedia')) {
CrudField::macro('withMedia', function ($uploadDefinition, $subfield = null, $registerEvents = true) {
CrudField::macro('withMedia', function ($uploadDefinition = [], $subfield = null, $registerEvents = true) {
$uploadDefinition = is_array($uploadDefinition) ? $uploadDefinition : [];
/** @var CrudField $this */
RegisterUploadEvents::handle($this, $uploadDefinition, 'withMedia', $subfield, $registerEvents);
Expand All @@ -45,7 +45,7 @@ public function boot()
}

if (! CrudColumn::hasMacro('withMedia')) {
CrudColumn::macro('withMedia', function ($uploadDefinition, $subfield = null, $registerEvents = true) {
CrudColumn::macro('withMedia', function ($uploadDefinition = [], $subfield = null, $registerEvents = true) {
$uploadDefinition = is_array($uploadDefinition) ? $uploadDefinition : [];
/** @var CrudColumn $this */
RegisterUploadEvents::handle($this, $uploadDefinition, 'withMedia', $subfield, $registerEvents);
Expand Down

0 comments on commit f071825

Please sign in to comment.