This commit is contained in:
2025-09-25 03:03:31 +05:00
commit ae480cf2f6
2768 changed files with 1485826 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
<?php
namespace Nurmuhammet\PayoutProducts;
use Illuminate\Support\ServiceProvider;
use Laravel\Nova\Events\ServingNova;
use Laravel\Nova\Nova;
class FieldServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Nova::serving(function (ServingNova $event) {
Nova::script('payout-products', __DIR__.'/../dist/js/field.js');
Nova::style('payout-products', __DIR__.'/../dist/css/field.css');
});
}
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
}

View File

@@ -0,0 +1,38 @@
<?php
namespace Nurmuhammet\PayoutProducts;
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Support\Collection;
use Laravel\Nova\Fields\Field;
use Laravel\Nova\Fields\SupportsDependentFields;
class PayoutProducts extends Field
{
use SupportsDependentFields;
/**
* The field's component.
*
* @var string
*/
public $component = 'payout-products';
/**
* Products to be rendered
*
* @param array $products
*/
public function products(array|callable|Collection $products): self
{
if (is_callable($products)) {
$products = call_user_func($products);
}
if ($products instanceof Arrayable) {
$products = $products->toArray();
}
return $this->withMeta(['products' => $products]);
}
}