generated from spatie/package-skeleton-laravel
-
-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
191 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace Saade\FilamentFullCalendar\Widgets\Concerns; | ||
|
||
use function Saade\FilamentFullCalendar\array_merge_recursive_unique; | ||
|
||
use Saade\FilamentFullCalendar\FilamentFullCalendarPlugin; | ||
|
||
trait CanBeConfigured | ||
{ | ||
public function config(): array | ||
{ | ||
return []; | ||
} | ||
|
||
protected function getConfig(): array | ||
{ | ||
return array_merge_recursive_unique( | ||
FilamentFullCalendarPlugin::get()->getConfig(), | ||
$this->config(), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
|
||
namespace Saade\FilamentFullCalendar\Widgets\Concerns; | ||
|
||
trait InteractsWithRawJS | ||
{ | ||
/** | ||
* A ClassName Input for adding classNames to the outermost event element. | ||
* If supplied as a callback function, it is called every time the associated event data changes. | ||
* | ||
* @see https://fullcalendar.io/docs/event-render-hooks | ||
* | ||
* @return string | ||
*/ | ||
public function eventClassNames(): string | ||
{ | ||
return <<<JS | ||
null | ||
JS; | ||
} | ||
|
||
/** | ||
* A Content Injection Input. Generated content is inserted inside the inner-most wrapper of the event element. | ||
* If supplied as a callback function, it is called every time the associated event data changes. | ||
* | ||
* @see https://fullcalendar.io/docs/event-render-hooks | ||
* | ||
* @return string | ||
*/ | ||
public function eventContent(): string | ||
{ | ||
return <<<JS | ||
null | ||
JS; | ||
} | ||
|
||
/** | ||
* Called right after the element has been added to the DOM. If the event data changes, this is NOT called again. | ||
* | ||
* @see https://fullcalendar.io/docs/event-render-hooks | ||
* | ||
* @return string | ||
*/ | ||
public function eventDidMount(): string | ||
{ | ||
return <<<JS | ||
null | ||
JS; | ||
} | ||
|
||
/** | ||
* Called right before the element will be removed from the DOM. | ||
* | ||
* @see https://fullcalendar.io/docs/event-render-hooks | ||
* | ||
* @return string | ||
*/ | ||
public function eventWillUnmount(): string | ||
{ | ||
return <<<JS | ||
null | ||
JS; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Saade\FilamentFullCalendar; | ||
|
||
if(! function_exists('Saade\FilamentFullCalendar\array_merge_recursive_unique')) { | ||
function array_merge_recursive_unique(array $array1, array $array2): array | ||
{ | ||
foreach ($array2 as $key => $value) { | ||
if (is_array($value) && isset($array1[$key]) && is_array($array1[$key])) { | ||
$array1[$key] = array_merge_recursive_unique($array1[$key], $value); | ||
} else { | ||
$array1[$key] = $value; | ||
} | ||
} | ||
|
||
return $array1; | ||
} | ||
} |