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
<div wire:key="carousel-{{ json_encode($images) }}"> | |
<div x-data="{ | |
images: @js($images), | |
current: 0, | |
isLoading: true, | |
startX: 0, | |
endX: 0, | |
prev() { | |
this.current = this.current === 0 ? this.images.length - 1 : this.current - 1; | |
}, |
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
<?php | |
# App\Http\Livewire\Traits\FilamentTableTabs | |
namespace App\Http\Livewire\Traits; | |
trait FilamentTableTabs | |
{ | |
public ?string $activeTab = null; |
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
<?php | |
namespace App\View\Components; | |
use App\Settings\GeneralSettings; | |
use FilamentCurator\Models\Media; | |
use Illuminate\Contracts\View\View; | |
use Illuminate\Database\Eloquent\Model; | |
use Illuminate\View\Component; |
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
<?php | |
## bottom of EditUser.php. Could be on View as well. | |
protected function getActions(): array | |
{ | |
return array_merge([ | |
ImpersonateButton::make('impersonate'), | |
], parent::getActions()); | |
} |
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
<?php | |
namespace App\Filament\Resources\PlanResource\Pages; | |
use App\Filament\Resources\PlanResource; | |
use App\Models\Plan; | |
use Filament\Resources\Pages\CreateRecord; | |
class CreatePlan extends CreateRecord | |
{ |
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
# ----------------------------------------------------------------- | |
# .gitignore | |
# Bare Minimum Git | |
# https://salferrarello.com/starter-gitignore-file/ | |
# ver 20210211 | |
# | |
# From the root of your project run | |
# curl -O https://gist.githubusercontent.com/salcode/10017553/raw/.gitignore | |
# to download this file | |
# |
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
<?php | |
.... | |
class Transaction extends Model | |
{ | |
..... | |
public function monitor_transaction() | |
{ |
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
<?php | |
namespace Filament\Forms\Components; | |
use Illuminate\Database\Eloquent\Relations\BelongsToMany; | |
use Illuminate\Support\Str; | |
class BelongsToManyCheckboxList extends MultiSelect | |
{ | |
use Concerns\CanBeInline; |
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
Just using a simple `role` field in the User table with a value like 'admin', then setting up the following gate in Providers/AuthServiceProvider.php | |
Gate::define('role', function ($user, ...$roles) { | |
if (in_array($user->role, $roles)) { | |
return true; | |
} | |
}); | |
Then in my livewire component methods and such, I am using the following to check multiple roles: |
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
<?php | |
namespace App\Http\Livewire; | |
use App\Models\Tag; | |
use Illuminate\View\View; | |
use Illuminate\Contracts\View\Factory; | |
use Illuminate\Contracts\Container\BindingResolutionException; | |
use Livewire\Component; |
NewerOlder