rimba / pelan
Models physical spaces (buildings, rooms, zones) for location-aware operations.
Requires
- php: ^8.3
- rimba/asas: ^1.3
- rimba/pihak: ^1.3
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-21 23:24:48 UTC
README
Includes:
- Team
LocationResourcewith parent and child locations and SVG upload stored atattributes.floorplan_svg. - Staff
FloorPlanpage with zoomable/pannable SVG image and clickable location table. - Shared
LocationAssignmentsRelationManagerfor any model usingHasLocationAssignments.
Required Location model correction
The existing model method is named childrens(). Rename it or add this canonical relationship:
public function children(): HasMany { return $this->hasMany(Location::class, 'parent_id'); }
The existing attributes cast to array is used, so no migration is required for the SVG path.
Register package views
In FloorplanServiceProvider::bootPackage():
$this->loadViewsFrom(__DIR__ . '/../resources/views', 'floorplan');
Shared relation manager integration
In an assignable model:
use Rimba\Floorplan\Models\Concerns\HasLocationAssignments; use HasLocationAssignments;
In its Filament Resource:
public static function getRelations(): array { return [ LocationAssignmentsRelationManager::class, ]; }
Storage
Run php artisan storage:link when using the public local disk. Ensure the configured disk can return a browser-accessible URL.
SVG safety
The Staff viewer renders the SVG through an <img> element rather than injecting raw SVG markup. Keep server-side MIME validation and apply your normal upload security controls.