openclassify/public/js/filament/tables/components/columns/toggle.js
copilot-swe-agent[bot] 64930897c3 feat: Install FilamentPHP v5, add Admin/Partner modules, Docker support
- Fix CI workflow: actions/checkout@v6 → v4
- Install FilamentPHP ^5.0 and spatie/laravel-permission ^7.2
- Remove laravel/breeze from require-dev (replaced by Filament auth)
- Update User model: implements FilamentUser, HasTenants, HasRoles
- Publish Spatie permission migrations for role-based access
- Create Admin module with FilamentPHP panel at /admin
  - UserResource, CategoryResource, ListingResource, LocationResource
  - Role-based access (admin role required)
- Create Partner module with tenant-isolated panel at /partner/{id}
  - ListingResource scoped to authenticated user
- Update modules_statuses.json: add Admin and Partner modules
- Update DatabaseSeeder: create admin/partner users with roles
- Improve seeders: LocationSeeder (10 countries), CategorySeeder (8 categories with children), ListingSeeder (10 sample listings)
- Add Docker support: Dockerfile, docker-compose.yml, docker-compose.dev.yml
- Add GitHub Codespaces: .devcontainer/devcontainer.json
- Update .env.example with Filament-relevant settings
- Update README.md with full documentation

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-03 08:07:28 +00:00

2 lines
910 B
JavaScript

function a({name:r,recordKey:s,state:n}){return{error:void 0,isLoading:!1,state:n,unsubscribeLivewireHook:null,init(){this.unsubscribeLivewireHook=Livewire.interceptMessage(({message:e,onSuccess:t})=>{t(()=>{this.$nextTick(()=>{if(this.isLoading||e.component.id!==this.$root.closest("[wire\\:id]")?.attributes["wire:id"].value)return;let i=this.getServerState();i===void 0||Alpine.raw(this.state)===i||(this.state=i)})})}),this.$watch("state",async()=>{let e=this.getServerState();if(e===void 0||Alpine.raw(this.state)===e)return;this.isLoading=!0;let t=await this.$wire.updateTableColumnState(r,s,this.state);this.error=t?.error??void 0,!this.error&&this.$refs.serverState&&(this.$refs.serverState.value=this.state?"1":"0"),this.isLoading=!1})},getServerState(){if(this.$refs.serverState)return[1,"1"].includes(this.$refs.serverState.value)},destroy(){this.unsubscribeLivewireHook?.()}}}export{a as default};