wip pp filter
This commit is contained in:
1 parent
fc1e1b2832
commit
55f31acf2a
23 files changed
+1118
-320
No files matched your search
+536
-26
@@ -5,7 +5,7 @@
|
||||
|
||||
/**
|
||||
* A helper file for Laravel, to provide autocomplete information to your IDE
|
||||
* Generated for Laravel 12.56.0.
|
||||
* Generated for Laravel 12.70.0.
|
||||
*
|
||||
* This file should not be included in your code, only analyzed by your IDE!
|
||||
*
|
||||
@@ -3349,6 +3349,19 @@ namespace Illuminate\Support\Facades {
|
||||
$instance->precompiler($precompiler);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the path to the compiled version of a view.
|
||||
*
|
||||
* @param string $path
|
||||
* @return string
|
||||
* @static
|
||||
*/
|
||||
public static function getCompiledPath($path)
|
||||
{
|
||||
/** @var \Illuminate\View\Compilers\BladeCompiler $instance */
|
||||
return $instance->getCompiledPath($path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the given callback using a custom echo format.
|
||||
*
|
||||
@@ -3412,20 +3425,6 @@ namespace Illuminate\Support\Facades {
|
||||
$instance->withoutComponentTags();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the path to the compiled version of a view.
|
||||
*
|
||||
* @param string $path
|
||||
* @return string
|
||||
* @static
|
||||
*/
|
||||
public static function getCompiledPath($path)
|
||||
{
|
||||
//Method inherited from \Illuminate\View\Compilers\Compiler
|
||||
/** @var \Illuminate\View\Compilers\BladeCompiler $instance */
|
||||
return $instance->getCompiledPath($path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the view at the given path is expired.
|
||||
*
|
||||
@@ -10379,6 +10378,20 @@ namespace Illuminate\Support\Facades {
|
||||
return $instance->globalOptions($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute a callback while requests are created without global middleware or global options.
|
||||
*
|
||||
* @template TReturn
|
||||
* @param (\Closure(): TReturn) $callback
|
||||
* @return TReturn
|
||||
* @static
|
||||
*/
|
||||
public static function withoutGlobalConfiguration($callback)
|
||||
{
|
||||
/** @var \Illuminate\Http\Client\Factory $instance */
|
||||
return $instance->withoutGlobalConfiguration($callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new response instance for use during stubbing.
|
||||
*
|
||||
@@ -14154,7 +14167,6 @@ namespace Illuminate\Support\Facades {
|
||||
|
||||
}
|
||||
/**
|
||||
* @method static \BackedEnum|(\BackedEnum|null enum(string $key, string $enumClass, \BackedEnum|null $default = null)
|
||||
* @see \Illuminate\Http\Request
|
||||
*/
|
||||
class Request {
|
||||
@@ -15134,10 +15146,6 @@ namespace Illuminate\Support\Facades {
|
||||
* being the original client, and each successive proxy that passed the request
|
||||
* adding the IP address where it received the request from.
|
||||
*
|
||||
* If your reverse proxy uses a different header name than "X-Forwarded-For",
|
||||
* ("Client-Ip" for instance), configure it via the $trustedHeaderSet
|
||||
* argument of the Request::setTrustedProxies() method instead.
|
||||
*
|
||||
* @see getClientIps()
|
||||
* @see https://wikipedia.org/wiki/X-Forwarded-For
|
||||
* @static
|
||||
@@ -20614,6 +20622,7 @@ namespace Illuminate\Support\Facades {
|
||||
* @param array $headers
|
||||
* @param string|null $disposition
|
||||
* @return \Symfony\Component\HttpFoundation\StreamedResponse
|
||||
* @throws UnableToRetrieveMetadata
|
||||
* @static
|
||||
*/
|
||||
public static function response($path, $name = null, $headers = [], $disposition = 'inline')
|
||||
@@ -20631,6 +20640,7 @@ namespace Illuminate\Support\Facades {
|
||||
* @param string|null $name
|
||||
* @param array $headers
|
||||
* @return \Symfony\Component\HttpFoundation\StreamedResponse
|
||||
* @throws UnableToRetrieveMetadata
|
||||
* @static
|
||||
*/
|
||||
public static function serve($request, $path, $name = null, $headers = [])
|
||||
@@ -20647,6 +20657,7 @@ namespace Illuminate\Support\Facades {
|
||||
* @param string|null $name
|
||||
* @param array $headers
|
||||
* @return \Symfony\Component\HttpFoundation\StreamedResponse
|
||||
* @throws UnableToRetrieveMetadata
|
||||
* @static
|
||||
*/
|
||||
public static function download($path, $name = null, $headers = [])
|
||||
@@ -20845,6 +20856,7 @@ namespace Illuminate\Support\Facades {
|
||||
*
|
||||
* @param string $path
|
||||
* @return string|false
|
||||
* @throws UnableToRetrieveMetadata
|
||||
* @static
|
||||
*/
|
||||
public static function mimeType($path)
|
||||
@@ -23447,6 +23459,41 @@ namespace Illuminate\Support\Facades {
|
||||
}
|
||||
}
|
||||
|
||||
namespace AnourValar\EloquentSerialize\Facades {
|
||||
/**
|
||||
*/
|
||||
class EloquentSerializeFacade {
|
||||
/**
|
||||
* Pack
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Relations\Relation $builder
|
||||
* @return string
|
||||
* @throws \RuntimeException
|
||||
* @static
|
||||
*/
|
||||
public static function serialize($builder)
|
||||
{
|
||||
/** @var \AnourValar\EloquentSerialize\Service $instance */
|
||||
return $instance->serialize($builder);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack
|
||||
*
|
||||
* @param mixed $package
|
||||
* @throws \LogicException
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
* @static
|
||||
*/
|
||||
public static function unserialize($package)
|
||||
{
|
||||
/** @var \AnourValar\EloquentSerialize\Service $instance */
|
||||
return $instance->unserialize($package);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
namespace Fruitcake\LaravelDebugbar\Facades {
|
||||
/**
|
||||
* @method static void alert(mixed $message)
|
||||
@@ -24191,6 +24238,24 @@ namespace BezhanSalleh\FilamentShield\Facades {
|
||||
return $instance->buildPermissionKeyUsing($callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* @static
|
||||
*/
|
||||
public static function enforcePolicies($condition = true, $except = null)
|
||||
{
|
||||
/** @var \BezhanSalleh\FilamentShield\FilamentShield $instance */
|
||||
return $instance->enforcePolicies($condition, $except);
|
||||
}
|
||||
|
||||
/**
|
||||
* @static
|
||||
*/
|
||||
public static function registerEnforcedPolicies()
|
||||
{
|
||||
/** @var \BezhanSalleh\FilamentShield\FilamentShield $instance */
|
||||
return $instance->registerEnforcedPolicies();
|
||||
}
|
||||
|
||||
/**
|
||||
* @static
|
||||
*/
|
||||
@@ -24327,6 +24392,19 @@ namespace BezhanSalleh\FilamentShield\Facades {
|
||||
}
|
||||
|
||||
/**
|
||||
* Transform custom permissions from config into formatted key => label pairs.
|
||||
*
|
||||
* When `format_custom_permission_keys` is enabled (default), permission keys are
|
||||
* formatted according to the configured case. If the key contains the configured
|
||||
* separator, each segment is formatted independently and rejoined.
|
||||
*
|
||||
* When a `buildPermissionKeyUsing` closure is registered, custom permissions are
|
||||
* routed through it with `entity` set to `'custom'` and `affix` set to `null`.
|
||||
* Returning `null` from the closure falls back to the default formatting behavior.
|
||||
*
|
||||
* When `format_custom_permission_keys` is disabled, keys are used exactly as
|
||||
* defined in config — useful for externally managed permissions (Terraform, Keycloak, etc.).
|
||||
*
|
||||
* @return array<string, string>
|
||||
* @static
|
||||
*/
|
||||
@@ -25545,6 +25623,299 @@ namespace Livewire {
|
||||
}
|
||||
}
|
||||
|
||||
namespace Maatwebsite\Excel\Facades {
|
||||
/**
|
||||
*/
|
||||
class Excel {
|
||||
/**
|
||||
* @param array<string, string> $headers
|
||||
* @param array<string, string> $headers
|
||||
* @throws Exception
|
||||
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
||||
* @static
|
||||
*/
|
||||
public static function download($export, $fileName, $writerType = null, $headers = [])
|
||||
{
|
||||
/** @var \Maatwebsite\Excel\Excel $instance */
|
||||
return $instance->download($export, $fileName, $writerType, $headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $disk Fallback for usage with named properties
|
||||
* @throws Exception
|
||||
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
||||
* @static
|
||||
*/
|
||||
public static function store($export, $filePath, $diskName = null, $writerType = null, $diskOptions = [], $disk = null)
|
||||
{
|
||||
/** @var \Maatwebsite\Excel\Excel $instance */
|
||||
return $instance->store($export, $filePath, $diskName, $writerType, $diskOptions, $disk);
|
||||
}
|
||||
|
||||
/**
|
||||
* @static
|
||||
*/
|
||||
public static function queue($export, $filePath, $disk = null, $writerType = null, $diskOptions = [])
|
||||
{
|
||||
/** @var \Maatwebsite\Excel\Excel $instance */
|
||||
return $instance->queue($export, $filePath, $disk, $writerType, $diskOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
* @static
|
||||
*/
|
||||
public static function raw($export, $writerType)
|
||||
{
|
||||
/** @var \Maatwebsite\Excel\Excel $instance */
|
||||
return $instance->raw($export, $writerType);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws ValidationException
|
||||
* @static
|
||||
*/
|
||||
public static function import($import, $filePath, $disk = null, $readerType = null)
|
||||
{
|
||||
/** @var \Maatwebsite\Excel\Excel $instance */
|
||||
return $instance->import($import, $filePath, $disk, $readerType);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<array-key, array<int, array<array-key, mixed>>>
|
||||
* @static
|
||||
*/
|
||||
public static function toArray($import, $filePath, $disk = null, $readerType = null)
|
||||
{
|
||||
/** @var \Maatwebsite\Excel\Excel $instance */
|
||||
return $instance->toArray($import, $filePath, $disk, $readerType);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<array-key, Collection<int, Collection<array-key, mixed>>>
|
||||
* @static
|
||||
*/
|
||||
public static function toCollection($import, $filePath, $disk = null, $readerType = null)
|
||||
{
|
||||
/** @var \Maatwebsite\Excel\Excel $instance */
|
||||
return $instance->toCollection($import, $filePath, $disk, $readerType);
|
||||
}
|
||||
|
||||
/**
|
||||
* @static
|
||||
*/
|
||||
public static function queueImport($import, $filePath, $disk = null, $readerType = null)
|
||||
{
|
||||
/** @var \Maatwebsite\Excel\Excel $instance */
|
||||
return $instance->queueImport($import, $filePath, $disk, $readerType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a custom export source handler.
|
||||
*
|
||||
* The handler may implement SheetSourceHandler (sync), QueuedSheetSourceHandler
|
||||
* (queued), or both. Pass a class name to have it resolved lazily from the
|
||||
* service container, or pass an instance directly.
|
||||
*
|
||||
* @param \Maatwebsite\Excel\Contracts\SheetSourceHandler|\Maatwebsite\Excel\Contracts\QueuedSheetSourceHandler|class-string $handlers
|
||||
* @static
|
||||
*/
|
||||
public static function registerSourceHandler(...$handlers)
|
||||
{
|
||||
/** @var \Maatwebsite\Excel\Excel $instance */
|
||||
return $instance->registerSourceHandler(...$handlers);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a custom macro.
|
||||
*
|
||||
* @param string $name
|
||||
* @param object|callable $macro
|
||||
* @param-closure-this static $macro
|
||||
* @return void
|
||||
* @static
|
||||
*/
|
||||
public static function macro($name, $macro)
|
||||
{
|
||||
\Maatwebsite\Excel\Excel::macro($name, $macro);
|
||||
}
|
||||
|
||||
/**
|
||||
* Mix another object into the class.
|
||||
*
|
||||
* @param object $mixin
|
||||
* @param bool $replace
|
||||
* @return void
|
||||
* @throws \ReflectionException
|
||||
* @static
|
||||
*/
|
||||
public static function mixin($mixin, $replace = true)
|
||||
{
|
||||
\Maatwebsite\Excel\Excel::mixin($mixin, $replace);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if macro is registered.
|
||||
*
|
||||
* @param string $name
|
||||
* @return bool
|
||||
* @static
|
||||
*/
|
||||
public static function hasMacro($name)
|
||||
{
|
||||
return \Maatwebsite\Excel\Excel::hasMacro($name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Flush the existing macros.
|
||||
*
|
||||
* @return void
|
||||
* @static
|
||||
*/
|
||||
public static function flushMacros()
|
||||
{
|
||||
\Maatwebsite\Excel\Excel::flushMacros();
|
||||
}
|
||||
|
||||
/**
|
||||
* @static
|
||||
*/
|
||||
public static function extend($concern, $handler, $event = 'Maatwebsite\\Excel\\Events\\BeforeWriting')
|
||||
{
|
||||
return \Maatwebsite\Excel\Excel::extend($concern, $handler, $event);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register local event listeners.
|
||||
*
|
||||
* @param array<string, callable> $listeners
|
||||
* @static
|
||||
*/
|
||||
public static function registerListeners($listeners)
|
||||
{
|
||||
/** @var \Maatwebsite\Excel\Excel $instance */
|
||||
return $instance->registerListeners($listeners);
|
||||
}
|
||||
|
||||
/**
|
||||
* @static
|
||||
*/
|
||||
public static function clearListeners()
|
||||
{
|
||||
/** @var \Maatwebsite\Excel\Excel $instance */
|
||||
return $instance->clearListeners();
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a global event listener.
|
||||
*
|
||||
* @static
|
||||
*/
|
||||
public static function listen($event, $listener)
|
||||
{
|
||||
return \Maatwebsite\Excel\Excel::listen($event, $listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* @static
|
||||
*/
|
||||
public static function raise($event)
|
||||
{
|
||||
/** @var \Maatwebsite\Excel\Excel $instance */
|
||||
return $instance->raise($event);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return callable[]
|
||||
* @static
|
||||
*/
|
||||
public static function listeners($event)
|
||||
{
|
||||
/** @var \Maatwebsite\Excel\Excel $instance */
|
||||
return $instance->listeners($event);
|
||||
}
|
||||
|
||||
/**
|
||||
* When asserting downloaded, stored, queued or imported, use regular expression
|
||||
* to look for a matching file path.
|
||||
*
|
||||
* @static
|
||||
*/
|
||||
public static function matchByRegex()
|
||||
{
|
||||
/** @var \Maatwebsite\Excel\Fakes\ExcelFake $instance */
|
||||
return $instance->matchByRegex();
|
||||
}
|
||||
|
||||
/**
|
||||
* When asserting downloaded, stored, queued or imported, use regular string
|
||||
* comparison for matching file path.
|
||||
*
|
||||
* @static
|
||||
*/
|
||||
public static function doNotMatchByRegex()
|
||||
{
|
||||
/** @var \Maatwebsite\Excel\Fakes\ExcelFake $instance */
|
||||
return $instance->doNotMatchByRegex();
|
||||
}
|
||||
|
||||
/**
|
||||
* @static
|
||||
*/
|
||||
public static function assertDownloaded($fileName, $callback = null)
|
||||
{
|
||||
/** @var \Maatwebsite\Excel\Fakes\ExcelFake $instance */
|
||||
return $instance->assertDownloaded($fileName, $callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* @static
|
||||
*/
|
||||
public static function assertStored($filePath, $disk = null, $callback = null)
|
||||
{
|
||||
/** @var \Maatwebsite\Excel\Fakes\ExcelFake $instance */
|
||||
return $instance->assertStored($filePath, $disk, $callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* @static
|
||||
*/
|
||||
public static function assertQueued($filePath, $disk = null, $callback = null)
|
||||
{
|
||||
/** @var \Maatwebsite\Excel\Fakes\ExcelFake $instance */
|
||||
return $instance->assertQueued($filePath, $disk, $callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<int, object> $chain
|
||||
* @static
|
||||
*/
|
||||
public static function assertQueuedWithChain($chain)
|
||||
{
|
||||
/** @var \Maatwebsite\Excel\Fakes\ExcelFake $instance */
|
||||
return $instance->assertQueuedWithChain($chain);
|
||||
}
|
||||
|
||||
/**
|
||||
* @static
|
||||
*/
|
||||
public static function assertExportedInRaw($classname, $callback = null)
|
||||
{
|
||||
/** @var \Maatwebsite\Excel\Fakes\ExcelFake $instance */
|
||||
return $instance->assertExportedInRaw($classname, $callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* @static
|
||||
*/
|
||||
public static function assertImported($filePath, $disk = null, $callback = null)
|
||||
{
|
||||
/** @var \Maatwebsite\Excel\Fakes\ExcelFake $instance */
|
||||
return $instance->assertImported($filePath, $disk, $callback);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
namespace Stevebauman\Location\Facades {
|
||||
/**
|
||||
*/
|
||||
@@ -25678,6 +26049,34 @@ namespace Illuminate\Support {
|
||||
return \Illuminate\Support\Collection::debug();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \Maatwebsite\Excel\Mixins\DownloadCollectionMixin::downloadExcel()
|
||||
* @param string $fileName
|
||||
* @param string|null $writerType
|
||||
* @param mixed $withHeadings
|
||||
* @param array $responseHeaders
|
||||
* @return \Symfony\Component\HttpFoundation\BinaryFileResponse
|
||||
* @static
|
||||
*/
|
||||
public static function downloadExcel($fileName, $writerType = null, $withHeadings = false, $responseHeaders = [])
|
||||
{
|
||||
return \Illuminate\Support\Collection::downloadExcel($fileName, $writerType, $withHeadings, $responseHeaders);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \Maatwebsite\Excel\Mixins\StoreCollectionMixin::storeExcel()
|
||||
* @param string $filePath
|
||||
* @param string|null $disk
|
||||
* @param string|null $writerType
|
||||
* @param mixed $withHeadings
|
||||
* @return \Illuminate\Foundation\Bus\PendingDispatch|bool
|
||||
* @static
|
||||
*/
|
||||
public static function storeExcel($filePath, $disk = null, $writerType = null, $withHeadings = false)
|
||||
{
|
||||
return \Illuminate\Support\Collection::storeExcel($filePath, $disk, $writerType, $withHeadings);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
*/
|
||||
@@ -25693,6 +26092,29 @@ namespace Illuminate\Support {
|
||||
return \Illuminate\Support\Str::sanitizeHtml($html);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \Filament\Support\SupportServiceProvider::packageBooted()
|
||||
* @param string|null $url
|
||||
* @param array $allowedSchemes
|
||||
* @return string|null
|
||||
* @static
|
||||
*/
|
||||
public static function sanitizeUrl($url, $allowedSchemes = [])
|
||||
{
|
||||
return \Illuminate\Support\Str::sanitizeUrl($url, $allowedSchemes);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \Filament\Support\SupportServiceProvider::packageBooted()
|
||||
* @param \BackedEnum|string|null $color
|
||||
* @return string|null
|
||||
* @static
|
||||
*/
|
||||
public static function sanitizeCssColor($color)
|
||||
{
|
||||
return \Illuminate\Support\Str::sanitizeCssColor($color);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
*/
|
||||
@@ -25707,6 +26129,27 @@ namespace Illuminate\Support {
|
||||
return \Illuminate\Support\Stringable::sanitizeHtml();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \Filament\Support\SupportServiceProvider::packageBooted()
|
||||
* @param array $allowedSchemes
|
||||
* @return \Illuminate\Support\Stringable
|
||||
* @static
|
||||
*/
|
||||
public static function sanitizeUrl($allowedSchemes = [])
|
||||
{
|
||||
return \Illuminate\Support\Stringable::sanitizeUrl($allowedSchemes);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \Filament\Support\SupportServiceProvider::packageBooted()
|
||||
* @return \Illuminate\Support\Stringable
|
||||
* @static
|
||||
*/
|
||||
public static function sanitizeCssColor()
|
||||
{
|
||||
return \Illuminate\Support\Stringable::sanitizeCssColor();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26123,6 +26566,9 @@ namespace Illuminate\Database\Eloquent\Relations {
|
||||
namespace Livewire\Features\SupportTesting {
|
||||
/**
|
||||
* @template TComponent of \Livewire\Component
|
||||
* @method $this assertSuccessful()
|
||||
* @method $this assertOk()
|
||||
* @method $this assertStatus(int $status)
|
||||
* @mixin \Illuminate\Testing\TestResponse
|
||||
*/
|
||||
class Testable {
|
||||
@@ -26140,12 +26586,13 @@ namespace Livewire\Features\SupportTesting {
|
||||
|
||||
/**
|
||||
* @see \Filament\Actions\Testing\TestsActions::unmountAction()
|
||||
* @param string|bool|null $cancelParentActions
|
||||
* @return static
|
||||
* @static
|
||||
*/
|
||||
public static function unmountAction()
|
||||
public static function unmountAction($cancelParentActions = null)
|
||||
{
|
||||
return \Livewire\Features\SupportTesting\Testable::unmountAction();
|
||||
return \Livewire\Features\SupportTesting\Testable::unmountAction($cancelParentActions);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -28815,7 +29262,7 @@ namespace Illuminate\View {
|
||||
/**
|
||||
* @see \Filament\Support\SupportServiceProvider::packageBooted()
|
||||
* @param array|string|int|null $span
|
||||
* @param array|int|null $start
|
||||
* @param array|string|int|null $start
|
||||
* @param array|string|int|null $order
|
||||
* @param bool $isHidden
|
||||
* @return \Illuminate\View\ComponentAttributeBag
|
||||
@@ -28843,6 +29290,7 @@ namespace Illuminate\View {
|
||||
/**
|
||||
* @see \Livewire\Features\SupportPageComponents\SupportPageComponents::registerLayoutViewMacros()
|
||||
* @param mixed $data
|
||||
* @return static
|
||||
* @static
|
||||
*/
|
||||
public static function layoutData($data = [])
|
||||
@@ -28853,6 +29301,7 @@ namespace Illuminate\View {
|
||||
/**
|
||||
* @see \Livewire\Features\SupportPageComponents\SupportPageComponents::registerLayoutViewMacros()
|
||||
* @param mixed $section
|
||||
* @return static
|
||||
* @static
|
||||
*/
|
||||
public static function section($section)
|
||||
@@ -28863,6 +29312,7 @@ namespace Illuminate\View {
|
||||
/**
|
||||
* @see \Livewire\Features\SupportPageComponents\SupportPageComponents::registerLayoutViewMacros()
|
||||
* @param mixed $title
|
||||
* @return static
|
||||
* @static
|
||||
*/
|
||||
public static function title($title)
|
||||
@@ -28873,6 +29323,7 @@ namespace Illuminate\View {
|
||||
/**
|
||||
* @see \Livewire\Features\SupportPageComponents\SupportPageComponents::registerLayoutViewMacros()
|
||||
* @param mixed $slot
|
||||
* @return static
|
||||
* @static
|
||||
*/
|
||||
public static function slot($slot)
|
||||
@@ -28884,6 +29335,7 @@ namespace Illuminate\View {
|
||||
* @see \Livewire\Features\SupportPageComponents\SupportPageComponents::registerLayoutViewMacros()
|
||||
* @param mixed $view
|
||||
* @param mixed $params
|
||||
* @return static
|
||||
* @static
|
||||
*/
|
||||
public static function extends($view, $params = [])
|
||||
@@ -28895,6 +29347,7 @@ namespace Illuminate\View {
|
||||
* @see \Livewire\Features\SupportPageComponents\SupportPageComponents::registerLayoutViewMacros()
|
||||
* @param mixed $view
|
||||
* @param mixed $params
|
||||
* @return static
|
||||
* @static
|
||||
*/
|
||||
public static function layout($view, $params = [])
|
||||
@@ -28905,6 +29358,7 @@ namespace Illuminate\View {
|
||||
/**
|
||||
* @see \Livewire\Features\SupportPageComponents\SupportPageComponents::registerLayoutViewMacros()
|
||||
* @param callable $callback
|
||||
* @return static
|
||||
* @static
|
||||
*/
|
||||
public static function response($callback)
|
||||
@@ -29577,7 +30031,7 @@ namespace {
|
||||
* @param string $pageName
|
||||
* @param int|null $page
|
||||
* @param \Closure|int|null $total
|
||||
* @return \Illuminate\Pagination\LengthAwarePaginator
|
||||
* @return \Illuminate\Pagination\LengthAwarePaginator<int, TModel>
|
||||
* @throws \InvalidArgumentException
|
||||
* @static
|
||||
*/
|
||||
@@ -29594,7 +30048,7 @@ namespace {
|
||||
* @param array|string $columns
|
||||
* @param string $pageName
|
||||
* @param int|null $page
|
||||
* @return \Illuminate\Contracts\Pagination\Paginator
|
||||
* @return \Illuminate\Pagination\Paginator<int, TModel>
|
||||
* @static
|
||||
*/
|
||||
public static function simplePaginate($perPage = null, $columns = [], $pageName = 'page', $page = null)
|
||||
@@ -29610,7 +30064,7 @@ namespace {
|
||||
* @param array|string $columns
|
||||
* @param string $cursorName
|
||||
* @param \Illuminate\Pagination\Cursor|string|null $cursor
|
||||
* @return \Illuminate\Contracts\Pagination\CursorPaginator
|
||||
* @return \Illuminate\Pagination\CursorPaginator<int, TModel>
|
||||
* @static
|
||||
*/
|
||||
public static function cursorPaginate($perPage = null, $columns = [], $cursorName = 'cursor', $cursor = null)
|
||||
@@ -31352,6 +31806,60 @@ namespace {
|
||||
return \Illuminate\Database\Eloquent\Builder::getRelationWithoutConstraintsProxy($relation);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \Maatwebsite\Excel\Mixins\DownloadQueryMacro::__invoke()
|
||||
* @param string $fileName
|
||||
* @param string|null $writerType
|
||||
* @param mixed $withHeadings
|
||||
* @return \Symfony\Component\HttpFoundation\BinaryFileResponse
|
||||
* @static
|
||||
*/
|
||||
public static function downloadExcel($fileName, $writerType = null, $withHeadings = false)
|
||||
{
|
||||
return \Illuminate\Database\Eloquent\Builder::downloadExcel($fileName, $writerType, $withHeadings);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \Maatwebsite\Excel\Mixins\StoreQueryMacro::__invoke()
|
||||
* @param string $filePath
|
||||
* @param string|null $disk
|
||||
* @param string|null $writerType
|
||||
* @param mixed $withHeadings
|
||||
* @return \Illuminate\Foundation\Bus\PendingDispatch|bool
|
||||
* @static
|
||||
*/
|
||||
public static function storeExcel($filePath, $disk = null, $writerType = null, $withHeadings = false)
|
||||
{
|
||||
return \Illuminate\Database\Eloquent\Builder::storeExcel($filePath, $disk, $writerType, $withHeadings);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \Maatwebsite\Excel\Mixins\ImportMacro::__invoke()
|
||||
* @param string $filename
|
||||
* @param string|null $disk
|
||||
* @param string|null $readerType
|
||||
* @return \Maatwebsite\Excel\Importer|\Illuminate\Foundation\Bus\PendingDispatch|\Illuminate\Bus\PendingBatch
|
||||
* @static
|
||||
*/
|
||||
public static function import($filename, $disk = null, $readerType = null)
|
||||
{
|
||||
return \Illuminate\Database\Eloquent\Builder::import($filename, $disk, $readerType);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \Maatwebsite\Excel\Mixins\ImportAsMacro::__invoke()
|
||||
* @param string $filename
|
||||
* @param callable $mapping
|
||||
* @param string|null $disk
|
||||
* @param string|null $readerType
|
||||
* @return \Maatwebsite\Excel\Importer|\Illuminate\Foundation\Bus\PendingDispatch|\Illuminate\Bus\PendingBatch
|
||||
* @static
|
||||
*/
|
||||
public static function importAs($filename, $mapping, $disk = null, $readerType = null)
|
||||
{
|
||||
return \Illuminate\Database\Eloquent\Builder::importAs($filename, $mapping, $disk, $readerType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the columns to be selected.
|
||||
*
|
||||
@@ -34404,10 +34912,12 @@ namespace {
|
||||
class Validator extends \Illuminate\Support\Facades\Validator {}
|
||||
class View extends \Illuminate\Support\Facades\View {}
|
||||
class Vite extends \Illuminate\Support\Facades\Vite {}
|
||||
class EloquentSerialize extends \AnourValar\EloquentSerialize\Facades\EloquentSerializeFacade {}
|
||||
class Debugbar extends \Fruitcake\LaravelDebugbar\Facades\Debugbar {}
|
||||
class FilamentShield extends \BezhanSalleh\FilamentShield\Facades\FilamentShield {}
|
||||
class Agent extends \Jenssegers\Agent\Facades\Agent {}
|
||||
class Livewire extends \Livewire\Livewire {}
|
||||
class Excel extends \Maatwebsite\Excel\Facades\Excel {}
|
||||
class Location extends \Stevebauman\Location\Facades\Location {}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ class ImportDetails
|
||||
$row['birthdate'] = isset($row['birthday']) ? Carbon::parse($row['birthday'])->format('Y-m-d') : '';
|
||||
unset($row['birthday']);
|
||||
$row['last_update'] = Carbon::parse($row['last_update'])->format('Y-m-d H:i:s');
|
||||
|
||||
$collection[] = $row;
|
||||
}
|
||||
}
|
||||
@@ -56,6 +57,6 @@ class ImportDetails
|
||||
|
||||
self::$teams = array_unique(self::$teams);
|
||||
|
||||
StatistikoDetail::where('last_import', 'no')->whereIn('ss_team_id', self::$teams)->update(['is_active' => 0, 'ss_team_id' => 0]);
|
||||
// StatistikoDetail::where('last_import', 'no')->whereIn('ss_team_id', self::$teams)->update(['is_active' => 0, 'ss_team_id' => 0]);
|
||||
}
|
||||
}
|
||||
@@ -90,18 +90,17 @@ class PlayerProps extends Page implements HasForms
|
||||
$this->selectMatch(),
|
||||
$this->selectTeam(),
|
||||
$this->selectLineup(),
|
||||
// $this->radioSeasonOrDate(),
|
||||
// $this->datePickerStartDate(),
|
||||
// $this->datePickerEndDate(),
|
||||
$this->radioSeasonOrDate(),
|
||||
$this->datePickerStartDate(),
|
||||
$this->datePickerEndDate(),
|
||||
])->statePath('filterData');
|
||||
}
|
||||
|
||||
#[On('team-update')]
|
||||
public function syncData(?int $team_id)
|
||||
public function syncData()
|
||||
{
|
||||
if ($team_id) {
|
||||
$this->team_id = $team_id;
|
||||
$this->clientLineUps = SsLineupMemory::where('team_id', $team_id)->where('client_id', Auth::user()->client_id)->pluck('lineup')->toArray();
|
||||
if ($this->team_id) {
|
||||
$this->clientLineUps = SsLineupMemory::where('team_id', $this->team_id)->where('client_id', Auth::user()->client_id)->pluck('lineup')->toArray();
|
||||
} else {
|
||||
$this->players = [];
|
||||
$this->dispatch('clear-all');
|
||||
@@ -302,6 +301,7 @@ class PlayerProps extends Page implements HasForms
|
||||
$set('mid', null);
|
||||
$set('tid', null);
|
||||
$this->dispatch('clear-all');
|
||||
$this->dispatch('season_mode-update', $state);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -317,9 +317,11 @@ class PlayerProps extends Page implements HasForms
|
||||
->default('season')
|
||||
->hiddenLabel()
|
||||
->options([
|
||||
'season' => 'Season',
|
||||
'season' => 'Active Season',
|
||||
'date' => 'Date',
|
||||
]);
|
||||
])->afterStateUpdated(function ($state) {
|
||||
$this->dispatch('season_or_date-update', season_or_date: $state);
|
||||
});
|
||||
}
|
||||
|
||||
private function datePickerStartDate(): DatePicker
|
||||
@@ -332,12 +334,15 @@ class PlayerProps extends Page implements HasForms
|
||||
->prefixIconColor(fn (Get $get): string => $get('start_date') ? 'success' : 'primary')
|
||||
->prefixIcon('phosphor-calendar')
|
||||
->prefix('Start')
|
||||
->closeOnDateSelection()
|
||||
->suffixAction(
|
||||
Action::make('clear_start')
|
||||
->icon('phosphor-x')
|
||||
->color('gray')
|
||||
->action(fn (Set $set) => $set('start_date', null))
|
||||
);
|
||||
)->afterStateUpdated(function ($state) {
|
||||
$this->dispatch('start_date-update', start_date: $state);
|
||||
});
|
||||
}
|
||||
|
||||
private function datePickerEndDate(): DatePicker
|
||||
@@ -350,11 +355,14 @@ class PlayerProps extends Page implements HasForms
|
||||
->prefixIconColor(fn (Get $get): string => $get('end_date') ? 'success' : 'primary')
|
||||
->prefixIcon('phosphor-calendar')
|
||||
->prefix('End')
|
||||
->closeOnDateSelection()
|
||||
->suffixAction(
|
||||
Action::make('clear_end')
|
||||
->icon('phosphor-x')
|
||||
->color('gray')
|
||||
->action(fn (Set $set) => $set('end_date', null))
|
||||
);
|
||||
)->afterStateUpdated(function ($state) {
|
||||
$this->dispatch('end_date-update', end_date: $state);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -6,14 +6,14 @@ use Illuminate\Support\Carbon;
|
||||
|
||||
class GetSeason
|
||||
{
|
||||
public static function load(?array $season, ?string $seasonmode)
|
||||
public static function load(?array $season, ?string $season_mode)
|
||||
{
|
||||
if (! \is_array($season) || ! \count($season)) {
|
||||
|
||||
$date = Carbon::now();
|
||||
|
||||
$season = [];
|
||||
if ($seasonmode == 'halfyear') {
|
||||
if ($season_mode == 'halfyear') {
|
||||
if ((int) date('m') > 7) {
|
||||
$season[] = (string) $date->format('y').'/'.$date->format('y') + 1;
|
||||
} else {
|
||||
@@ -27,13 +27,13 @@ class GetSeason
|
||||
return $season;
|
||||
}
|
||||
|
||||
public static function active(?string $seasonmode)
|
||||
public static function active(?string $season_mode)
|
||||
{
|
||||
|
||||
$date = Carbon::now();
|
||||
|
||||
$active_season = '';
|
||||
if ($seasonmode == 'halfyear') {
|
||||
if ($season_mode == 'halfyear') {
|
||||
if ((int) date('m') > 7) {
|
||||
$active_season = (string) $date->format('y').'/'.$date->format('y') + 1;
|
||||
} else {
|
||||
|
||||
@@ -3,14 +3,20 @@
|
||||
namespace App\Filament\Pages\Selections;
|
||||
|
||||
use App\Filament\Pages\Selections\Helper\GetSeason;
|
||||
use App\Filament\Widgets\Boxes\LoadPlayerAverages;
|
||||
use App\Models\StatistikoDetail;
|
||||
use App\Models\StatistikoEvent;
|
||||
use App\Models\StatistikoPlayer;
|
||||
|
||||
class LoadPlayerSelection
|
||||
{
|
||||
public static function load(?int $team_id, ?string $team_position, ?array $season, ?string $seasonmode)
|
||||
public static function load(?array $arr)
|
||||
{
|
||||
$season = GetSeason::load($season, $seasonmode);
|
||||
$team_id = $arr['team_id'];
|
||||
|
||||
$team_position = $arr['team_position'];
|
||||
|
||||
$season = GetSeason::load($arr['season'], $arr['season_mode']);
|
||||
|
||||
$matches = StatistikoEvent::whereIn('season', $season)
|
||||
->where(function ($query) use ($team_id, $team_position) {
|
||||
switch ($team_position) {
|
||||
@@ -22,30 +28,50 @@ class LoadPlayerSelection
|
||||
return $query->where('home_id', '=', $team_id)
|
||||
->orWhere('away_id', '=', $team_id);
|
||||
}
|
||||
})->pluck('match_id')->toArray();
|
||||
})->get();
|
||||
|
||||
$matches_count = count($matches);
|
||||
$matches_count = $matches->count();
|
||||
|
||||
$positions_map = LoadPositions::load();
|
||||
|
||||
$players = LoadPlayerAverages::load($team_id, $season);
|
||||
$player_name_map = [];
|
||||
$res = StatistikoDetail::where('ss_team_id', $team_id)->get();
|
||||
foreach ($res as $val) {
|
||||
$player_name_map[$val->ss_player_id]['name'] = $val->player_name;
|
||||
$player_name_map[$val->ss_player_id]['pos'] = $val->position;
|
||||
$player_name_map[$val->ss_player_id]['foot'] = $val->preferred_foot;
|
||||
}
|
||||
|
||||
$arr = [];
|
||||
foreach ($players as $ss_player_id => $val) {
|
||||
foreach ($matches as $match) {
|
||||
$players = StatistikoPlayer::where('match_id', $match->match_id)->get();
|
||||
foreach ($players as $val) {
|
||||
$ss_player_id = (int) $val->ss_player_id;
|
||||
|
||||
if (isset($player_name_map[$ss_player_id])) {
|
||||
|
||||
$activeteam_id = (int) $val->activeteam_id;
|
||||
$minutes_played = (int) $val->minutes_played;
|
||||
|
||||
if (! isset($arr[$ss_player_id])) {
|
||||
$arr[$ss_player_id]['player_name'] = $val['player_name'];
|
||||
$arr[$ss_player_id]['events_played_home'] = $val['events_played_home'];
|
||||
$arr[$ss_player_id]['events_played_away'] = $val['events_played_away'];
|
||||
$arr[$ss_player_id]['minutes_played_home'] = $val['minutes_played_home'];
|
||||
$arr[$ss_player_id]['minutes_played_away'] = $val['minutes_played_away'];
|
||||
$arr[$ss_player_id]['preferred_foot'] = $val['preferred_foot'] ?? '';
|
||||
$arr[$ss_player_id]['player_position'] = $val['position'] ?? '';
|
||||
self::array_template($arr, $ss_player_id);
|
||||
$arr[$ss_player_id]['player_name'] = $player_name_map[$ss_player_id]['name'] ?? '';
|
||||
$arr[$ss_player_id]['preferred_foot'] = $player_name_map[$ss_player_id]['foot'] ?? '';
|
||||
$arr[$ss_player_id]['player_position'] = $player_name_map[$ss_player_id]['pos'] ?? '';
|
||||
$arr[$ss_player_id]['color_level'] = round($matches_count / 3);
|
||||
} else {
|
||||
$arr[$ss_player_id]['events_played_home'] += $val['events_played_home'];
|
||||
$arr[$ss_player_id]['events_played_away'] += $val['events_played_away'];
|
||||
$arr[$ss_player_id]['minutes_played_home'] += $val['minutes_played_home'];
|
||||
$arr[$ss_player_id]['minutes_played_away'] += $val['minutes_played_away'];
|
||||
}
|
||||
|
||||
if ($activeteam_id == $match->home_id) {
|
||||
$arr[$ss_player_id]['events_played_home'] += 1;
|
||||
$arr[$ss_player_id]['minutes_played_home'] += $minutes_played;
|
||||
$arr[$ss_player_id]['events_played_home'] += 1;
|
||||
$arr[$ss_player_id]['minutes_played_home'] += $minutes_played;
|
||||
} elseif ($activeteam_id == $match->away_id) {
|
||||
$arr[$ss_player_id]['events_played_away'] += 1;
|
||||
$arr[$ss_player_id]['minutes_played_away'] += $minutes_played;
|
||||
$arr[$ss_player_id]['events_played_away'] += 1;
|
||||
$arr[$ss_player_id]['minutes_played_away'] += $minutes_played;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,4 +144,16 @@ class LoadPlayerSelection
|
||||
|
||||
return sprintf($format, $hours, $minutes);
|
||||
}
|
||||
|
||||
public static function array_template(array &$arr, int $ss_player_id)
|
||||
{
|
||||
$arr[$ss_player_id]['ss_player_id'] = 0;
|
||||
$arr[$ss_player_id]['color_level'] = 0;
|
||||
$arr[$ss_player_id]['preferred_foot'] = '';
|
||||
$arr[$ss_player_id]['player_position'] = '';
|
||||
$arr[$ss_player_id]['events_played_home'] = 0;
|
||||
$arr[$ss_player_id]['events_played_away'] = 0;
|
||||
$arr[$ss_player_id]['minutes_played_home'] = 0;
|
||||
$arr[$ss_player_id]['minutes_played_away'] = 0;
|
||||
}
|
||||
}
|
||||
@@ -7,16 +7,16 @@ use Illuminate\Support\Carbon;
|
||||
|
||||
class LoadSeasons
|
||||
{
|
||||
public static function load(string $seasonmode)
|
||||
public static function load(string $season_mode)
|
||||
{
|
||||
if (! $seasonmode) {
|
||||
if (! $season_mode) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$season = [];
|
||||
$period = CarbonPeriod::create(Carbon::now()->year(2024), '1 year', Carbon::now());
|
||||
foreach ($period as $date) {
|
||||
if ($seasonmode == 'halfyear') {
|
||||
if ($season_mode == 'halfyear') {
|
||||
if ((int) date('m') > 7) {
|
||||
$tmp = $date->format('y').'/'.$date->format('y') + 1;
|
||||
} else {
|
||||
|
||||
@@ -136,7 +136,7 @@ class Statistic extends BaseDashboard
|
||||
])
|
||||
->columnSpanFull()
|
||||
->schema([
|
||||
Hidden::make('seasonmode'),
|
||||
Hidden::make('season_mode'),
|
||||
$this->selectSofascoreCategoryId(),
|
||||
$this->selectLeagueId(),
|
||||
$this->selectMatchId(),
|
||||
@@ -348,7 +348,7 @@ class Statistic extends BaseDashboard
|
||||
->options(fn () => LoadSofaScoreCategory::load())
|
||||
->placeholder('Select Country')
|
||||
->afterStateUpdated(function (callable $set, $state) {
|
||||
$set('seasonmode', SofaScoreCategory::where('id', $state)->value('season_mode'));
|
||||
$set('season_mode', SofaScoreCategory::where('id', $state)->value('season_mode'));
|
||||
$set('league_id', null);
|
||||
$set('match_id', null);
|
||||
$set('team_id', null);
|
||||
@@ -559,9 +559,9 @@ class Statistic extends BaseDashboard
|
||||
->placeholder('Player')
|
||||
->visible(fn (Get $get) => $get('team_id'))
|
||||
->hidden(fn (Get $get) => $get('similar_past_matches') != 'none')
|
||||
->disabled(fn (Get $get) => $get('season_or_date') == 'date' && ($get('start_date') == null || $get('end_date') == null))
|
||||
->prefixIconColor(fn (Get $get): string => $get('similar_past_matches') == 'none' ? 'success' : '')
|
||||
->prefixIcon('icon-player')
|
||||
->preload()
|
||||
->searchable()
|
||||
->extraAttributes(fn () => [
|
||||
'id' => 'player_selector',
|
||||
@@ -574,12 +574,18 @@ class Statistic extends BaseDashboard
|
||||
->tooltip(fn () => $this->tooltip_player_info())
|
||||
)
|
||||
->options(function (Get $get) {
|
||||
$team_id = $get('team_id');
|
||||
$team_position = $get('team_position');
|
||||
$season = $get('season');
|
||||
$seasonmode = $get('seasonmode');
|
||||
$arr = [
|
||||
'team_id' => $get('team_id'),
|
||||
'team_position' => $get('team_position'),
|
||||
'season' => $get('season'),
|
||||
'season_mode' => $get('season_mode'),
|
||||
'season_or_date' => $get('season_or_date'),
|
||||
'start_date' => $get('start_date'),
|
||||
'end_date' => $get('end_date'),
|
||||
];
|
||||
|
||||
return LoadPlayerSelection::load($arr);
|
||||
|
||||
return LoadPlayerSelection::load($team_id, $team_position, $season, $seasonmode);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -634,7 +640,7 @@ class Statistic extends BaseDashboard
|
||||
->hidden(fn (Get $get) => $get('season_or_date') == 'date' || $get('similar_past_matches') != 'none')
|
||||
->prefixIcon('phosphor-calendar-star')
|
||||
->options(function (Get $get) {
|
||||
if ($get('seasonmode') == 'halfyear') {
|
||||
if ($get('season_mode') == 'halfyear') {
|
||||
return ['26/27' => '26/27', '25/26' => '25/26', '24/25' => '24/25'];
|
||||
} else {
|
||||
return ['2026' => '2026', '2025' => '2025', '2024' => '2024'];
|
||||
|
||||
@@ -16,8 +16,8 @@ class AverageLeagueSeason
|
||||
public static function load(array &$expectations, array $filter)
|
||||
{
|
||||
$tournament_id = (int) $filter['league_id'] ?? 0;
|
||||
$seasonmode = $filter['seasonmode'];
|
||||
$active_season = GetSeason::active($seasonmode);
|
||||
$season_mode = $filter['season_mode'];
|
||||
$active_season = GetSeason::active($season_mode);
|
||||
|
||||
$res = StatistikoEvent::where('league_id', $tournament_id)
|
||||
->when($active_season, function ($query) use ($active_season) {
|
||||
|
||||
@@ -22,14 +22,14 @@ class AverageTeam
|
||||
$season_or_date = $filter['season_or_date'] ?? 'season';
|
||||
$start = $filter['start_date'] ?? 0;
|
||||
$end = $filter['end_date'] ?? 0;
|
||||
$seasonmode = $filter['seasonmode'];
|
||||
$season_mode = $filter['season_mode'];
|
||||
|
||||
if ($season_or_date != 'season') {
|
||||
$season = 0;
|
||||
} else {
|
||||
$end = 0;
|
||||
$start = 0;
|
||||
$season = GetSeason::load($season, $seasonmode);
|
||||
$season = GetSeason::load($season, $season_mode);
|
||||
}
|
||||
|
||||
$res = StatistikoEvent::where('league_id', $tournament_id)
|
||||
|
||||
@@ -16,8 +16,8 @@ class AverageTeamSeason
|
||||
$tournament_id = (int) $filter['league_id'] ?? 0;
|
||||
$team_position = $filter['team_position'];
|
||||
$team_id = (int) $filter['team_id'] ?? 0;
|
||||
$seasonmode = $filter['seasonmode'];
|
||||
$season = GetSeason::active($seasonmode);
|
||||
$season_mode = $filter['season_mode'];
|
||||
$season = GetSeason::active($season_mode);
|
||||
|
||||
$res = StatistikoEvent::where('league_id', $tournament_id)
|
||||
->when($season, function ($query) use ($season) {
|
||||
|
||||
@@ -1,132 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Widgets\Boxes;
|
||||
|
||||
use App\Models\StatistikoDetail;
|
||||
use App\Models\StatistikoEvent;
|
||||
use App\Models\StatistikoPlayer;
|
||||
|
||||
class LoadPlayerAverages
|
||||
{
|
||||
public static function load(int &$team_id, string|array $season)
|
||||
{
|
||||
// dd($team_id);
|
||||
|
||||
$players = StatistikoDetail::where('ss_team_id', $team_id)->where('is_active', 1)->get();
|
||||
|
||||
$player_ids = [];
|
||||
foreach ($players as $player) {
|
||||
$player_ids[] = $player->ss_player_id;
|
||||
}
|
||||
|
||||
$arr = [];
|
||||
|
||||
if (is_array($season)) {
|
||||
$matches_for_season = StatistikoEvent::whereIn('season', $season)->pluck('match_id')->toArray();
|
||||
$res = StatistikoPlayer::with('details')->whereIn('match_id', $matches_for_season)->whereIn('ss_player_id', $player_ids)->get();
|
||||
} else {
|
||||
$res = StatistikoPlayer::with('details')->whereIn('ss_player_id', $player_ids)->get();
|
||||
}
|
||||
|
||||
foreach ($res as $val) {
|
||||
|
||||
$ss_player_id = (int) $val->ss_player_id;
|
||||
$activeteam_id = (int) $val->activeteam_id;
|
||||
$minutes_played = (int) $val->minutes_played;
|
||||
$home_id = (int) $val->event->home_id;
|
||||
$away_id = (int) $val->event->away_id;
|
||||
$startime = $val->event->starttime;
|
||||
|
||||
if ($startime->greaterThan(now()->subDays(180))) {
|
||||
$last_180_days = true;
|
||||
} else {
|
||||
$last_180_days = false;
|
||||
}
|
||||
|
||||
if (! isset($arr[$ss_player_id])) {
|
||||
self::array_template($arr, $ss_player_id);
|
||||
}
|
||||
|
||||
if ($activeteam_id == $home_id) {
|
||||
$arr[$ss_player_id]['events_played_home'] += 1;
|
||||
$arr[$ss_player_id]['minutes_played_home'] += $minutes_played;
|
||||
$arr[$ss_player_id]['events_played_home'] += 1;
|
||||
$arr[$ss_player_id]['minutes_played_home'] += $minutes_played;
|
||||
if ($last_180_days) {
|
||||
$arr[$ss_player_id]['events_played_home'] += 1;
|
||||
$arr[$ss_player_id]['minutes_played_home'] += $minutes_played;
|
||||
}
|
||||
} elseif ($activeteam_id == $away_id) {
|
||||
$arr[$ss_player_id]['events_played_away'] += 1;
|
||||
$arr[$ss_player_id]['minutes_played_away'] += $minutes_played;
|
||||
$arr[$ss_player_id]['events_played_away'] += 1;
|
||||
$arr[$ss_player_id]['minutes_played_away'] += $minutes_played;
|
||||
if ($last_180_days) {
|
||||
$arr[$ss_player_id]['events_played_away'] += 1;
|
||||
$arr[$ss_player_id]['minutes_played_away'] += $minutes_played;
|
||||
}
|
||||
|
||||
}
|
||||
$cards = $val->card_yellow + $val->card_yellowred;
|
||||
|
||||
if ($season == 'last180days' && $last_180_days) {
|
||||
$arr[$ss_player_id]['ss_player_id'] = $ss_player_id;
|
||||
$arr[$ss_player_id]['total_events']++;
|
||||
$arr[$ss_player_id]['total_min'] += $minutes_played;
|
||||
$arr[$ss_player_id]['average_min'] = round($arr[$ss_player_id]['total_min'] / $arr[$ss_player_id]['total_events']);
|
||||
$arr[$ss_player_id]['goals'] += $val->goals;
|
||||
$arr[$ss_player_id]['fouls'] += $val->fouls;
|
||||
$arr[$ss_player_id]['cards'] += $cards;
|
||||
$arr[$ss_player_id]['offsides'] += $val->offsides;
|
||||
$arr[$ss_player_id]['shots_on_target'] += $val->shots_on_target;
|
||||
$arr[$ss_player_id]['shots_off_target'] += $val->shots_off_target;
|
||||
$arr[$ss_player_id]['shots_blocked'] += $val->shots_blocked;
|
||||
$arr[$ss_player_id]['total_shots'] += $val->shots_on_target + $val->shots_off_target + $val->shots_blocked;
|
||||
}
|
||||
if ($season != 'last180days') {
|
||||
$arr[$ss_player_id]['ss_player_id'] = $ss_player_id;
|
||||
$arr[$ss_player_id]['total_events']++;
|
||||
$arr[$ss_player_id]['total_min'] += $minutes_played;
|
||||
$arr[$ss_player_id]['average_min'] = round($arr[$ss_player_id]['total_min'] / $arr[$ss_player_id]['total_events']);
|
||||
$arr[$ss_player_id]['goals'] += $val->goals;
|
||||
$arr[$ss_player_id]['fouls'] += $val->fouls;
|
||||
$arr[$ss_player_id]['cards'] += $cards;
|
||||
$arr[$ss_player_id]['offsides'] += $val->offsides;
|
||||
$arr[$ss_player_id]['shots_on_target'] += $val->shots_on_target;
|
||||
$arr[$ss_player_id]['shots_off_target'] += $val->shots_off_target;
|
||||
$arr[$ss_player_id]['shots_blocked'] += $val->shots_blocked;
|
||||
$arr[$ss_player_id]['total_shots'] += $val->shots_on_target + $val->shots_off_target + $val->shots_blocked;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($players as $value) {
|
||||
if (isset($arr[$value->ss_player_id])) {
|
||||
$arr[$value->ss_player_id]['position'] = $value->position;
|
||||
$arr[$value->ss_player_id]['player_name'] = $value->player_name;
|
||||
$arr[$value->ss_player_id]['preferred_foot'] = $value->preferred_foot;
|
||||
}
|
||||
}
|
||||
|
||||
return $arr;
|
||||
}
|
||||
|
||||
public static function array_template(array &$arr, int $ss_player_id)
|
||||
{
|
||||
$arr[$ss_player_id]['ss_player_id'] = 0;
|
||||
$arr[$ss_player_id]['total_events'] = 0;
|
||||
$arr[$ss_player_id]['total_min'] = 0;
|
||||
$arr[$ss_player_id]['average_min'] = 0;
|
||||
$arr[$ss_player_id]['events_played_home'] = 0;
|
||||
$arr[$ss_player_id]['events_played_away'] = 0;
|
||||
$arr[$ss_player_id]['minutes_played_home'] = 0;
|
||||
$arr[$ss_player_id]['minutes_played_away'] = 0;
|
||||
$arr[$ss_player_id]['goals'] = 0;
|
||||
$arr[$ss_player_id]['fouls'] = 0;
|
||||
$arr[$ss_player_id]['offsides'] = 0;
|
||||
$arr[$ss_player_id]['shots_on_target'] = 0;
|
||||
$arr[$ss_player_id]['shots_off_target'] = 0;
|
||||
$arr[$ss_player_id]['shots_blocked'] = 0;
|
||||
$arr[$ss_player_id]['total_shots'] = 0;
|
||||
$arr[$ss_player_id]['cards'] = 0;
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ class LoadEventsQuery
|
||||
$league_id = (int) $filter['league_id'] ?? 0;
|
||||
$team_id = (int) $filter['team_id'] ?? 0;
|
||||
$season = $filter['season'];
|
||||
$seasonmode = $filter['seasonmode'];
|
||||
$season_mode = $filter['season_mode'];
|
||||
$season_or_date = $filter['season_or_date'];
|
||||
$start = $filter['start_date'] ?? 0;
|
||||
$end = $filter['end_date'] ?? 0;
|
||||
@@ -42,7 +42,7 @@ class LoadEventsQuery
|
||||
}
|
||||
|
||||
// dd($season);
|
||||
$season = GetSeason::load($season, $seasonmode);
|
||||
$season = GetSeason::load($season, $season_mode);
|
||||
|
||||
/**
|
||||
* IF WITH PLAYER
|
||||
|
||||
@@ -12,7 +12,7 @@ class LoadEventsQueryAll
|
||||
{
|
||||
$league_id = (int) $filter['league_id'] ?? 0;
|
||||
$season = $filter['season'];
|
||||
$seasonmode = $filter['seasonmode'];
|
||||
$season_mode = $filter['season_mode'];
|
||||
$season_or_date = $filter['season_or_date'];
|
||||
$accuracy = (float) $filter['accuracy'] ?? 0.5;
|
||||
$start = $filter['start_date'] ?? 0;
|
||||
@@ -36,7 +36,7 @@ class LoadEventsQueryAll
|
||||
}
|
||||
|
||||
// dd($season);
|
||||
$season = GetSeason::load($season, $seasonmode);
|
||||
$season = GetSeason::load($season, $season_mode);
|
||||
|
||||
/**
|
||||
* IF WITH PLAYER
|
||||
|
||||
@@ -13,7 +13,7 @@ class LoadEventsQueryTP
|
||||
$league_id = (int) $filter['league_id'] ?? 0;
|
||||
$team_id = (int) $filter['team_id'] ?? 0;
|
||||
$season = $filter['season'];
|
||||
$seasonmode = $filter['seasonmode'];
|
||||
$season_mode = $filter['season_mode'];
|
||||
$season_or_date = $filter['season_or_date'];
|
||||
$accuracy = (float) $filter['accuracy'] ?? 0.5;
|
||||
$start = $filter['start_date'] ?? 0;
|
||||
@@ -40,7 +40,7 @@ class LoadEventsQueryTP
|
||||
}
|
||||
|
||||
// dd($season);
|
||||
$season = GetSeason::load($season, $seasonmode);
|
||||
$season = GetSeason::load($season, $season_mode);
|
||||
|
||||
/**
|
||||
* IF WITH PLAYER
|
||||
|
||||
@@ -44,12 +44,12 @@ class LoadPerformance
|
||||
$end = $filter['end_date'] ?? 0;
|
||||
$season_or_date = $filter['season_or_date'];
|
||||
$season = $filter['season'];
|
||||
$seasonmode = $filter['seasonmode'];
|
||||
$season_mode = $filter['season_mode'];
|
||||
if ($season_or_date == 'season') {
|
||||
$start = 0;
|
||||
$end = 0;
|
||||
}
|
||||
$season = GetSeason::load($season, $seasonmode);
|
||||
$season = GetSeason::load($season, $season_mode);
|
||||
|
||||
$team_map = SofaScoreRosa::pluck('ss_team_name', 'ss_team_id')->toArray();
|
||||
|
||||
|
||||
@@ -30,8 +30,8 @@ class LoadPlayerWidgets
|
||||
$player_on_field = $filter['player_on_field'] ?? 'all';
|
||||
|
||||
$season = $filter['season'];
|
||||
$seasonmode = $filter['seasonmode'];
|
||||
$season = GetSeason::load($season, $seasonmode);
|
||||
$season_mode = $filter['season_mode'];
|
||||
$season = GetSeason::load($season, $season_mode);
|
||||
|
||||
// dd($player_on_field);
|
||||
|
||||
|
||||
@@ -2,19 +2,24 @@
|
||||
|
||||
namespace App\Filament\Widgets;
|
||||
|
||||
use App\Filament\Widgets\Boxes\LoadPlayerAverages;
|
||||
use App\Filament\Pages\Selections\LoadPositions;
|
||||
use App\Filament\Pages\Selections\LoadSeasons;
|
||||
use App\Filament\Widgets\PlayerProps\BoxNames;
|
||||
use App\Filament\Widgets\PlayerProps\Expectations;
|
||||
use App\Filament\Widgets\PlayerProps\LineUpMap;
|
||||
use App\Filament\Widgets\PlayerProps\PositionHirarchie;
|
||||
use App\Livewire\PlayerCalculator;
|
||||
use App\Models\ExpectedMinimumPosition;
|
||||
use App\Models\SofaScoreCategory;
|
||||
use App\Models\SofaScorePlayerPosition;
|
||||
use App\Models\SofaScoreRosa;
|
||||
use App\Models\SsLineupMemory;
|
||||
use App\Models\StatisticFixtures;
|
||||
use App\Models\StatistikoDetail;
|
||||
use App\Models\StatistikoEvent;
|
||||
use App\Models\StatistikoPlayer;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Widgets\Widget;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
@@ -45,6 +50,16 @@ class PlayerPropsDrop extends Widget
|
||||
|
||||
public string $team_name = '';
|
||||
|
||||
public string $season_or_date = 'season';
|
||||
|
||||
public string $season_mode = '';
|
||||
|
||||
public array $season;
|
||||
|
||||
public string $start_date = '';
|
||||
|
||||
public string $end_date = '';
|
||||
|
||||
public int $team_id = 0;
|
||||
|
||||
public int $match_id = 0;
|
||||
@@ -59,6 +74,8 @@ class PlayerPropsDrop extends Widget
|
||||
{
|
||||
$this->activeBoxes = BoxNames::load();
|
||||
|
||||
$this->season_or_date = 'season';
|
||||
|
||||
$this->lineUpMap = LineUpMap::load();
|
||||
|
||||
$this->player_on_field_counter = 0;
|
||||
@@ -103,15 +120,79 @@ class PlayerPropsDrop extends Widget
|
||||
}
|
||||
|
||||
#[On('team-update')]
|
||||
public function syncData(?int $team_id)
|
||||
public function teamUpdate(int $team_id)
|
||||
{
|
||||
if ($team_id) {
|
||||
|
||||
$this->players = PlayerCalculator::load($team_id);
|
||||
|
||||
$this->team_name = SofaScoreRosa::where('ss_team_id', $team_id)->value('ss_team_name');
|
||||
|
||||
$this->team_id = $team_id;
|
||||
|
||||
$this->syncData();
|
||||
}
|
||||
|
||||
public function syncData()
|
||||
{
|
||||
if ($this->team_id) {
|
||||
$this->players = [];
|
||||
|
||||
$positions_map = LoadPositions::load();
|
||||
|
||||
$players = $this->loadAverages();
|
||||
|
||||
foreach ($players as $val) {
|
||||
|
||||
$tmp = [];
|
||||
$tmp['id'] = $val['ss_player_id'];
|
||||
$tmp['name'] = $val['player_name'];
|
||||
$tmp['pos_ori'] = $val['position'];
|
||||
$tmp['foot'] = $val['preferred_foot'];
|
||||
$tmp['pos'] = '';
|
||||
$tmp['active'] = 0;
|
||||
$tmp['tot_evt'] = $val['total_events'];
|
||||
$tmp['tot_min'] = $val['total_min'];
|
||||
$tmp['ave_min'] = $val['average_min'];
|
||||
$tmp['gls'] = $val['goals'];
|
||||
$tmp['fls'] = $val['fouls'];
|
||||
$tmp['ofs'] = $val['offsides'];
|
||||
$tmp['crd'] = $val['cards'];
|
||||
$tmp['snt'] = $val['shots_on_target'];
|
||||
$tmp['tsh'] = $val['shots_off_target'];
|
||||
|
||||
$level = round($val['total_events'] / 3);
|
||||
if ($val['total_events']) {
|
||||
if ($level > 1 && $val['total_events'] < $level) {
|
||||
$tmp['color_evt'] = 'danger';
|
||||
} elseif ($val['total_events'] < $level * 2) {
|
||||
$tmp['color_evt'] = 'info';
|
||||
} else {
|
||||
$tmp['color_evt'] = 'success';
|
||||
}
|
||||
}
|
||||
|
||||
if (in_array($val['position'], $positions_map['MIDFIELD'])) {
|
||||
$tmp['area'] = 'midfield';
|
||||
$tmp['color_pos'] = 'info';
|
||||
$tmp['order'] = 2;
|
||||
} elseif (in_array($val['position'], $positions_map['DEFENCE'])) {
|
||||
$tmp['area'] = 'defence';
|
||||
$tmp['color_pos'] = 'success';
|
||||
$tmp['order'] = 1;
|
||||
} elseif (in_array($val['position'], $positions_map['ATTACK'])) {
|
||||
$tmp['area'] = 'attack';
|
||||
$tmp['color_pos'] = 'warning';
|
||||
$tmp['order'] = 3;
|
||||
} elseif (in_array($val['position'], $positions_map['GOALKEEPER'])) {
|
||||
$tmp['area'] = 'goalkeeper';
|
||||
$tmp['color_pos'] = 'gray';
|
||||
$tmp['order'] = 4;
|
||||
} else {
|
||||
$tmp['area'] = 'defence';
|
||||
$tmp['color_pos'] = 'success';
|
||||
$tmp['order'] = 5;
|
||||
}
|
||||
|
||||
$this->players[] = $tmp;
|
||||
}
|
||||
|
||||
$this->team_name = SofaScoreRosa::where('ss_team_id', $this->team_id)->value('ss_team_name');
|
||||
|
||||
$this->loadPlacement();
|
||||
} else {
|
||||
$this->team_name = '';
|
||||
@@ -124,8 +205,14 @@ class PlayerPropsDrop extends Widget
|
||||
public function lineUpUpdate(int|string $activeLineUp)
|
||||
{
|
||||
$this->activeLineUp = $activeLineUp;
|
||||
|
||||
$this->lineup = $this->lineUpMap[$activeLineUp];
|
||||
|
||||
$this->loadPlacement();
|
||||
|
||||
$this->generateLineUp();
|
||||
|
||||
$this->calculateAspg();
|
||||
}
|
||||
|
||||
#[On('element-dropped-in-box')]
|
||||
@@ -168,6 +255,44 @@ class PlayerPropsDrop extends Widget
|
||||
}
|
||||
}
|
||||
|
||||
#[On('season_or_date-update')]
|
||||
public function setSeasonOrData(string $season_or_date)
|
||||
{
|
||||
$this->season_or_date = $season_or_date;
|
||||
|
||||
if ($this->player_on_field_counter >= 10) {
|
||||
$this->calculateAspg();
|
||||
}
|
||||
}
|
||||
|
||||
#[On('start_date-update')]
|
||||
public function setStartDate(string $start_date)
|
||||
{
|
||||
$this->start_date = $start_date;
|
||||
|
||||
if ($this->player_on_field_counter >= 10) {
|
||||
$this->calculateAspg();
|
||||
}
|
||||
}
|
||||
|
||||
#[On('end_date-update')]
|
||||
public function setEndDate(string $end_date)
|
||||
{
|
||||
$this->end_date = $end_date;
|
||||
|
||||
if ($this->player_on_field_counter >= 10) {
|
||||
$this->calculateAspg();
|
||||
}
|
||||
}
|
||||
|
||||
#[On('season_mode-update')]
|
||||
public function setSeason(string $country_id)
|
||||
{
|
||||
$season_mode = SofaScoreCategory::where('id', $country_id)->value('season_mode');
|
||||
$this->season_mode = $season_mode;
|
||||
$this->season = LoadSeasons::load($season_mode);
|
||||
}
|
||||
|
||||
public function loadPlacement()
|
||||
{
|
||||
$this->clearResultTable();
|
||||
@@ -377,6 +502,8 @@ class PlayerPropsDrop extends Widget
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Log::info($this->team_id, ['calculateAspg']);
|
||||
// Calcolare Aspettativa Team per GOALS
|
||||
// (il valore che appare quando viene selezionato un Evento): nell' esempio,
|
||||
// se scegliamo come Team il Remo (Home) il valore di riferimento sarà 1.2
|
||||
@@ -391,8 +518,16 @@ class PlayerPropsDrop extends Widget
|
||||
$asp_team = (float) $match->exp_away;
|
||||
$team_home_away = 'away';
|
||||
}
|
||||
$arr = [
|
||||
'team_id' => $this->team_id,
|
||||
'season_or_date' => $this->season_or_date,
|
||||
'season' => $this->season,
|
||||
'season_mode' => $this->season_mode,
|
||||
'start_date' => $this->end_date,
|
||||
'end_date' => $this->end_date,
|
||||
];
|
||||
|
||||
$players = LoadPlayerAverages::load($team_id, 'total');
|
||||
$players = $this->loadAverages();
|
||||
|
||||
$count_player = 0;
|
||||
foreach ($players as $ss_player_id => $value) {
|
||||
@@ -684,7 +819,16 @@ class PlayerPropsDrop extends Widget
|
||||
|
||||
public function prepareLineUp()
|
||||
{
|
||||
$players = LoadPlayerAverages::load($this->team_id, 'last180days');
|
||||
$arr = [
|
||||
'team_id' => $this->team_id,
|
||||
'season_or_date' => $this->season_or_date,
|
||||
'season' => $this->season,
|
||||
'season_mode' => $this->season_mode,
|
||||
'start_date' => $this->start_date,
|
||||
'end_date' => $this->end_date,
|
||||
];
|
||||
|
||||
$players = $this->loadAverages();
|
||||
|
||||
$arr = collect();
|
||||
foreach ($players as $value) {
|
||||
@@ -867,4 +1011,129 @@ class PlayerPropsDrop extends Widget
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function loadAverages(): array
|
||||
{
|
||||
if (! $this->team_id) {
|
||||
return [];
|
||||
}
|
||||
// Log::debug('loadAverages', ['team_id' => $this->team_id]);
|
||||
|
||||
$players = StatistikoDetail::where('ss_team_id', $this->team_id)->where('is_active', 1)->get();
|
||||
|
||||
$player_ids = [];
|
||||
|
||||
foreach ($players as $player) {
|
||||
$player_ids[] = $player->ss_player_id;
|
||||
}
|
||||
|
||||
// Log::debug('loadAverages', ['player_ids' => $player_ids]);
|
||||
|
||||
$start_date = null;
|
||||
$end_date = null;
|
||||
if ($this->season_or_date == 'season') {
|
||||
$now = Carbon::now();
|
||||
if ($this->season_mode == 'halfyear') {
|
||||
if ((int) $now->month > 6) {
|
||||
$season_start = $now->startOfYear()->addMonths(7);
|
||||
} else {
|
||||
$season_start = $now->startOfYear()->subMonths(7);
|
||||
}
|
||||
} else {
|
||||
$season_start = $now->startOfYear();
|
||||
}
|
||||
} else {
|
||||
$season_start = '';
|
||||
$start_date = Carbon::parse($this->start_date);
|
||||
$end_date = Carbon::parse($this->end_date);
|
||||
// Log::debug('start end', [$start_date->format('Y-m-d').' - '.$end_date->format('Y-m-d')]);
|
||||
}
|
||||
|
||||
$match_ids = StatistikoEvent::when($start_date, function ($query) use ($start_date) {
|
||||
return $query->whereDate('starttime', '>', $start_date);
|
||||
})->when($end_date, function ($query) use ($end_date) {
|
||||
return $query->whereDate('starttime', '<', $end_date);
|
||||
})->when($season_start, function ($query) use ($season_start) {
|
||||
return $query->whereDate('starttime', '>', $season_start);
|
||||
})->pluck('match_id')->toArray();
|
||||
|
||||
// Log::debug('loadAverages', ['match_ids' => $match_ids]);
|
||||
|
||||
$res = StatistikoPlayer::with('details')
|
||||
->whereIn('ss_player_id', $player_ids)
|
||||
->whereIn('match_id', $match_ids)
|
||||
->get();
|
||||
|
||||
$arr = [];
|
||||
foreach ($res as $val) {
|
||||
|
||||
$ss_player_id = (int) $val->ss_player_id;
|
||||
$activeteam_id = (int) $val->activeteam_id;
|
||||
$minutes_played = (int) $val->minutes_played;
|
||||
$home_id = (int) $val->event->home_id;
|
||||
$away_id = (int) $val->event->away_id;
|
||||
|
||||
if (! isset($arr[$ss_player_id])) {
|
||||
self::array_template($arr, $ss_player_id);
|
||||
}
|
||||
|
||||
if ($activeteam_id == $home_id) {
|
||||
$arr[$ss_player_id]['events_played_home'] += 1;
|
||||
$arr[$ss_player_id]['minutes_played_home'] += $minutes_played;
|
||||
$arr[$ss_player_id]['events_played_home'] += 1;
|
||||
$arr[$ss_player_id]['minutes_played_home'] += $minutes_played;
|
||||
} elseif ($activeteam_id == $away_id) {
|
||||
$arr[$ss_player_id]['events_played_away'] += 1;
|
||||
$arr[$ss_player_id]['minutes_played_away'] += $minutes_played;
|
||||
$arr[$ss_player_id]['events_played_away'] += 1;
|
||||
$arr[$ss_player_id]['minutes_played_away'] += $minutes_played;
|
||||
}
|
||||
$cards = $val->card_yellow + $val->card_yellowred;
|
||||
|
||||
$arr[$ss_player_id]['ss_player_id'] = $ss_player_id;
|
||||
$arr[$ss_player_id]['total_events']++;
|
||||
$arr[$ss_player_id]['total_min'] += $minutes_played;
|
||||
$arr[$ss_player_id]['average_min'] = round($arr[$ss_player_id]['total_min'] / $arr[$ss_player_id]['total_events']);
|
||||
$arr[$ss_player_id]['goals'] += $val->goals;
|
||||
$arr[$ss_player_id]['fouls'] += $val->fouls;
|
||||
$arr[$ss_player_id]['cards'] += $cards;
|
||||
$arr[$ss_player_id]['offsides'] += $val->offsides;
|
||||
$arr[$ss_player_id]['shots_on_target'] += $val->shots_on_target;
|
||||
$arr[$ss_player_id]['shots_off_target'] += $val->shots_off_target;
|
||||
$arr[$ss_player_id]['shots_blocked'] += $val->shots_blocked;
|
||||
$arr[$ss_player_id]['total_shots'] += $val->shots_on_target + $val->shots_off_target + $val->shots_blocked;
|
||||
}
|
||||
|
||||
foreach ($players as $value) {
|
||||
if (isset($arr[$value->ss_player_id])) {
|
||||
$arr[$value->ss_player_id]['position'] = $value->position;
|
||||
$arr[$value->ss_player_id]['player_name'] = $value->player_name;
|
||||
$arr[$value->ss_player_id]['preferred_foot'] = $value->preferred_foot;
|
||||
}
|
||||
}
|
||||
|
||||
// Log::debug('loadAverages final', $arr);
|
||||
|
||||
return $arr;
|
||||
}
|
||||
|
||||
public static function array_template(array &$arr, int $ss_player_id)
|
||||
{
|
||||
$arr[$ss_player_id]['ss_player_id'] = 0;
|
||||
$arr[$ss_player_id]['total_events'] = 0;
|
||||
$arr[$ss_player_id]['total_min'] = 0;
|
||||
$arr[$ss_player_id]['average_min'] = 0;
|
||||
$arr[$ss_player_id]['events_played_home'] = 0;
|
||||
$arr[$ss_player_id]['events_played_away'] = 0;
|
||||
$arr[$ss_player_id]['minutes_played_home'] = 0;
|
||||
$arr[$ss_player_id]['minutes_played_away'] = 0;
|
||||
$arr[$ss_player_id]['goals'] = 0;
|
||||
$arr[$ss_player_id]['fouls'] = 0;
|
||||
$arr[$ss_player_id]['offsides'] = 0;
|
||||
$arr[$ss_player_id]['shots_on_target'] = 0;
|
||||
$arr[$ss_player_id]['shots_off_target'] = 0;
|
||||
$arr[$ss_player_id]['shots_blocked'] = 0;
|
||||
$arr[$ss_player_id]['total_shots'] = 0;
|
||||
$arr[$ss_player_id]['cards'] = 0;
|
||||
}
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire;
|
||||
|
||||
use App\Filament\Pages\Selections\LoadPositions;
|
||||
use App\Filament\Widgets\Boxes\LoadPlayerAverages;
|
||||
use Livewire\Component;
|
||||
|
||||
class PlayerCalculator extends Component
|
||||
{
|
||||
public static function load(int $team_id)
|
||||
{
|
||||
$positions_map = LoadPositions::load();
|
||||
|
||||
$players = LoadPlayerAverages::load($team_id, 'total');
|
||||
|
||||
$result = [];
|
||||
foreach ($players as $val) {
|
||||
|
||||
$tmp = [];
|
||||
$tmp['id'] = $val['ss_player_id'];
|
||||
$tmp['name'] = $val['player_name'];
|
||||
$tmp['pos_ori'] = $val['position'];
|
||||
$tmp['foot'] = $val['preferred_foot'];
|
||||
$tmp['pos'] = '';
|
||||
$tmp['active'] = 0;
|
||||
$tmp['tot_evt'] = $val['total_events'];
|
||||
$tmp['tot_min'] = $val['total_min'];
|
||||
$tmp['ave_min'] = $val['average_min'];
|
||||
$tmp['gls'] = $val['goals'];
|
||||
$tmp['fls'] = $val['fouls'];
|
||||
$tmp['ofs'] = $val['offsides'];
|
||||
$tmp['crd'] = $val['cards'];
|
||||
$tmp['snt'] = $val['shots_on_target'];
|
||||
$tmp['tsh'] = $val['shots_off_target'];
|
||||
|
||||
$level = round($val['total_events'] / 3);
|
||||
if ($val['total_events']) {
|
||||
if ($level > 1 && $val['total_events'] < $level) {
|
||||
$tmp['color_evt'] = 'danger';
|
||||
} elseif ($val['total_events'] < $level * 2) {
|
||||
$tmp['color_evt'] = 'info';
|
||||
} else {
|
||||
$tmp['color_evt'] = 'success';
|
||||
}
|
||||
}
|
||||
|
||||
if (in_array($val['position'], $positions_map['MIDFIELD'])) {
|
||||
$tmp['area'] = 'midfield';
|
||||
$tmp['color_pos'] = 'info';
|
||||
$tmp['order'] = 2;
|
||||
} elseif (in_array($val['position'], $positions_map['DEFENCE'])) {
|
||||
$tmp['area'] = 'defence';
|
||||
$tmp['color_pos'] = 'success';
|
||||
$tmp['order'] = 1;
|
||||
} elseif (in_array($val['position'], $positions_map['ATTACK'])) {
|
||||
$tmp['area'] = 'attack';
|
||||
$tmp['color_pos'] = 'warning';
|
||||
$tmp['order'] = 3;
|
||||
} elseif (in_array($val['position'], $positions_map['GOALKEEPER'])) {
|
||||
$tmp['area'] = 'goalkeeper';
|
||||
$tmp['color_pos'] = 'gray';
|
||||
$tmp['order'] = 4;
|
||||
} else {
|
||||
$tmp['area'] = 'defence';
|
||||
$tmp['color_pos'] = 'success';
|
||||
$tmp['order'] = 5;
|
||||
}
|
||||
|
||||
$result[] = $tmp;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@@ -5,9 +5,12 @@ namespace App\Providers;
|
||||
use App\Filament\Resources\Events\Pages\ListEvents;
|
||||
use BezhanSalleh\FilamentShield\Facades\FilamentShield;
|
||||
use Carbon\Carbon;
|
||||
use Filament\Notifications\Livewire\Notifications;
|
||||
use Filament\Support\Assets\Css;
|
||||
use Filament\Support\Assets\Js;
|
||||
use Filament\Support\Colors\Color;
|
||||
use Filament\Support\Enums\Alignment;
|
||||
use Filament\Support\Enums\VerticalAlignment;
|
||||
use Filament\Support\Facades\FilamentAsset;
|
||||
use Filament\Support\Facades\FilamentColor;
|
||||
use Filament\Support\Facades\FilamentTimezone;
|
||||
@@ -37,6 +40,9 @@ class AppServiceProvider extends ServiceProvider
|
||||
|
||||
FilamentTimezone::set('Europe/Vienna');
|
||||
|
||||
Notifications::alignment(Alignment::Center);
|
||||
Notifications::verticalAlignment(VerticalAlignment::Start);
|
||||
|
||||
/** Alpine Plugin direct */
|
||||
FilamentView::registerRenderHook(
|
||||
'panels::head.end',
|
||||
|
||||
@@ -141,7 +141,7 @@ trait GrappingSofascore
|
||||
|
||||
$daily_way = $this->select_daily_days();
|
||||
|
||||
if ($this->ask_settings_download()) {
|
||||
if ($this->ask_settings_download() == 'yes') {
|
||||
$this->settings_to_local();
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ trait GrappingSofascore
|
||||
/**
|
||||
* day 1
|
||||
*/
|
||||
if (in_array($daily_way, [1, 3])) {
|
||||
if (in_array($daily_way, [1, 2])) {
|
||||
$day = Carbon::now()->subDay()->format('Y-m-d');
|
||||
|
||||
$this->grapped_files = $this->get_tree($this->data_dir.'/'.$day);
|
||||
@@ -178,7 +178,7 @@ trait GrappingSofascore
|
||||
/**
|
||||
* day 5
|
||||
*/
|
||||
if (in_array($daily_way, [2, 3])) {
|
||||
if (in_array($daily_way, [1, 3])) {
|
||||
$day = Carbon::now()->subDays(5)->format('Y-m-d');
|
||||
|
||||
$this->grapped_files = $this->get_tree($this->data_dir.'/'.$day);
|
||||
@@ -345,13 +345,17 @@ trait GrappingSofascore
|
||||
|
||||
protected function select_daily_days(): string
|
||||
{
|
||||
$yesterday = Carbon::yesterday()->format('Y-m-d');
|
||||
$moredays = Carbon::now()->subDays(5)->format('Y-m-d');
|
||||
|
||||
return select(
|
||||
label: 'What days should be grapped?',
|
||||
scroll: 10,
|
||||
default: 1,
|
||||
options: [
|
||||
1 => 'Day 1',
|
||||
2 => 'Day 2',
|
||||
3 => 'Day 1 & 2',
|
||||
1 => "$yesterday & $moredays",
|
||||
2 => $yesterday,
|
||||
3 => $moredays,
|
||||
]
|
||||
);
|
||||
}
|
||||
@@ -407,10 +411,10 @@ trait GrappingSofascore
|
||||
{
|
||||
return select(
|
||||
label: 'Download setting?',
|
||||
default: 0,
|
||||
default: 'no',
|
||||
options: [
|
||||
0 => 'No',
|
||||
1 => 'Yes',
|
||||
'no' => 'No',
|
||||
'yes' => 'Yes',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ use App\Utilities\Notice;
|
||||
use Illuminate\Support\Facades\File;
|
||||
|
||||
use function Laravel\Prompts\select;
|
||||
use function Laravel\Prompts\text;
|
||||
|
||||
trait GrappingTeams
|
||||
{
|
||||
@@ -26,6 +27,8 @@ trait GrappingTeams
|
||||
// ENG1, ESP1, ITA1, ITA2, FRA1 e GER1
|
||||
$major = [8, 17, 23, 34, 35, 53];
|
||||
|
||||
$this->speed = $this->ask_speed();
|
||||
|
||||
$what = $this->select_what_to_grap();
|
||||
|
||||
if ($this->restart) {
|
||||
@@ -37,10 +40,13 @@ trait GrappingTeams
|
||||
case 'major':
|
||||
$tournaments = SofaScoreTournament::where('enabled', 1)->whereIn('tournament_id', $major)->pluck('tournament_id')->toArray();
|
||||
break;
|
||||
|
||||
default:
|
||||
case 'others':
|
||||
$tournaments = SofaScoreTournament::where('enabled', 1)->whereNotIn('tournament_id', $major)->pluck('tournament_id')->toArray();
|
||||
break;
|
||||
default:
|
||||
$tmp = self::load_tornament_ids();
|
||||
$tournaments = explode(',', $tmp);
|
||||
break;
|
||||
}
|
||||
|
||||
$tmp = SofaScoreRosaTournament::whereIn('ss_tournament_id', $tournaments)->pluck('ss_team_id')->toArray();
|
||||
@@ -95,7 +101,16 @@ trait GrappingTeams
|
||||
options: [
|
||||
'major' => 'Major Leagues',
|
||||
'others' => 'Others Leagues',
|
||||
'manual' => 'Enter team_ids (sofa_score_rosas)',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
protected function load_tornament_ids(): string
|
||||
{
|
||||
return text(
|
||||
label: 'Enter CSV Team Id (from table sofa_score_rosas)',
|
||||
default: '',
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -31,6 +31,7 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"barryvdh/laravel-debugbar": "*",
|
||||
"barryvdh/laravel-ide-helper": "^3.7",
|
||||
"fakerphp/faker": "*",
|
||||
"filament/upgrade": "^5.0",
|
||||
"laravel/pail": "*",
|
||||
|
||||
Generated
+148
-1
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "5c1a30c60933343a06d5d23fce85a4f5",
|
||||
"content-hash": "94233135ac6f53ec89f00776ca67026d",
|
||||
"packages": [
|
||||
{
|
||||
"name": "agencetwogether/hookshelper",
|
||||
@@ -10568,6 +10568,153 @@
|
||||
],
|
||||
"time": "2026-09-24T10:05:29+00:00"
|
||||
},
|
||||
{
|
||||
"name": "barryvdh/laravel-ide-helper",
|
||||
"version": "v3.7.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/barryvdh/laravel-ide-helper.git",
|
||||
"reference": "ad7e37676f1ff985d55ef1b6b96a0c0a40f2609a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/ad7e37676f1ff985d55ef1b6b96a0c0a40f2609a",
|
||||
"reference": "ad7e37676f1ff985d55ef1b6b96a0c0a40f2609a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"barryvdh/reflection-docblock": "^2.4",
|
||||
"composer/class-map-generator": "^1.0",
|
||||
"ext-json": "*",
|
||||
"illuminate/console": "^11.15 || ^12 || ^13.0",
|
||||
"illuminate/database": "^11.15 || ^12 || ^13.0",
|
||||
"illuminate/filesystem": "^11.15 || ^12 || ^13.0",
|
||||
"illuminate/support": "^11.15 || ^12 || ^13.0",
|
||||
"php": "^8.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-pdo_sqlite": "*",
|
||||
"friendsofphp/php-cs-fixer": "^3",
|
||||
"illuminate/config": "^11.15 || ^12 || ^13.0",
|
||||
"illuminate/view": "^11.15 || ^12 || ^13.0",
|
||||
"larastan/larastan": "^3.1",
|
||||
"mockery/mockery": "^1.4",
|
||||
"orchestra/testbench": "^9.2 || ^10 || ^11.0",
|
||||
"phpstan/phpstan-phpunit": "^2.0",
|
||||
"phpunit/phpunit": "^10.5 || ^11.5.3 || ^12.5.12",
|
||||
"spatie/phpunit-snapshot-assertions": "^4 || ^5",
|
||||
"vlucas/phpdotenv": "^5"
|
||||
},
|
||||
"suggest": {
|
||||
"illuminate/events": "Required for automatic helper generation (^6|^7|^8|^9|^10|^11)."
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider"
|
||||
]
|
||||
},
|
||||
"branch-alias": {
|
||||
"dev-master": "3.6-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Barryvdh\\LaravelIdeHelper\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Barry vd. Heuvel",
|
||||
"email": "barryvdh@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.",
|
||||
"keywords": [
|
||||
"autocomplete",
|
||||
"codeintel",
|
||||
"dev",
|
||||
"helper",
|
||||
"ide",
|
||||
"laravel",
|
||||
"netbeans",
|
||||
"phpdoc",
|
||||
"phpstorm",
|
||||
"sublime"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/barryvdh/laravel-ide-helper/issues",
|
||||
"source": "https://github.com/barryvdh/laravel-ide-helper/tree/v3.7.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://fruitcake.nl",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/barryvdh",
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2026-03-17T14:12:51+00:00"
|
||||
},
|
||||
{
|
||||
"name": "barryvdh/reflection-docblock",
|
||||
"version": "v2.4.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/barryvdh/ReflectionDocBlock.git",
|
||||
"reference": "4f5ba70c30c81f2ce03a16a9965832cfcc31ed3b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/barryvdh/ReflectionDocBlock/zipball/4f5ba70c30c81f2ce03a16a9965832cfcc31ed3b",
|
||||
"reference": "4f5ba70c30c81f2ce03a16a9965832cfcc31ed3b",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^8.5.14|^9"
|
||||
},
|
||||
"suggest": {
|
||||
"dflydev/markdown": "~1.0",
|
||||
"erusev/parsedown": "~1.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.3.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Barryvdh": [
|
||||
"src/"
|
||||
]
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Mike van Riel",
|
||||
"email": "mike.vanriel@naenius.com"
|
||||
}
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/barryvdh/ReflectionDocBlock/tree/v2.4.1"
|
||||
},
|
||||
"time": "2026-03-05T20:09:01+00:00"
|
||||
},
|
||||
{
|
||||
"name": "brianium/paratest",
|
||||
"version": "v7.8.6",
|
||||
|
||||
Reference in new issue
Block a user