Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Felice Ostuni committed Jun 12, 2024
1 parent 0d45a73 commit a31abeb
Showing 1 changed file with 2 additions and 42 deletions.
44 changes: 2 additions & 42 deletions src/RapydServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Zofe\Rapyd;

use Illuminate\Foundation\Http\Events\RequestHandled;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
use Livewire\Livewire;
Expand Down Expand Up @@ -86,49 +87,9 @@ public function boot()
});


Artisan::call('rpd:make:home');

/*
Blade::directive('rapydScripts', function () {
return "
<script src=\"{{ asset('vendor/rapyd-livewire/rapyd.js') }}\" defer></script>;
<?php echo \$__env->yieldPushContent('rapyd_scripts'); ?>
{!! \Livewire\Livewire::mount('rpd-app')->html(); !!}
";
});
Blade::directive('rapydStyles', function () {
return "
<link rel=\"stylesheet\" href=\"{{ asset('vendor/rapyd-livewire/rapyd.css') }}\">
<?php echo \$__env->yieldPushContent('rapyd_styles'); ?>
";
});
Blade::directive('rapydLivewireScripts', function ($expression) {
$scripts = "";
$scripts .= '{!! \Livewire\Livewire::scripts('.$expression.') !!}'."\n";
$scripts .= "<?php echo \$__env->yieldPushContent('rapyd_scripts'); ?>\n";
$scripts .= '{!! \Livewire\Livewire::mount(\'rpd-app\'); !!}'."\n";
$scripts .= '<script src="{{ asset(\'vendor/rapyd-livewire/rapyd.js\') }}"></script>'."\n";
if (in_array('alpine', config('rapyd-livewire.include_scripts'))) {
$scripts .= '<script src="{{ asset(\'vendor/rapyd-livewire/alpine.js\') }}" defer></script>' . "\n";
}
if (in_array('bootstrap', config('rapyd-livewire.include_scripts'))) {
$scripts .= '<script src="{{ asset(\'vendor/rapyd-livewire/bootstrap.js\') }}" defer></script>'."\n";
}
return $scripts;
});
Blade::directive('rapydLivewireStyles', function ($expression) {
$styles = '<link rel="stylesheet" href="{{ asset(\'vendor/rapyd-livewire/rapyd.css\') }}">'."\n";
if (in_array('bootstrap', config('rapyd-livewire.include_styles'))) {
$styles .= '<link rel="stylesheet" href="{{ asset(\'vendor/rapyd-livewire/bootstrap.css\') }}">' . "\n";
}
$styles .= '{!! \Livewire\Livewire::styles('.$expression.') !!}';
$styles .= "<?php echo \$__env->yieldPushContent('rapyd_styles'); ?>\n";
return $styles;
});
Blade::directive('ifcomponent', function ($expression) {
return "<?php if((bool) array_key_exists($expression, app(\Livewire\LivewireComponentsFinder::class)->getManifest())): ?>\n";
Expand All @@ -140,7 +101,6 @@ public function boot()
Livewire::component('rpd-app', RapydApp::class);
if (! Collection::hasMacro('paginate')) {
Collection::macro('paginate', function ($perPage, $total = null, $page = null, $pageName = 'page') {
$currentPage = LengthAwarePaginator::resolveCurrentPage($pageName);
Expand Down

0 comments on commit a31abeb

Please sign in to comment.