filament-select-tree

php 2023. 11. 14. 23:44

라라벨에는 crud 리소스를 자동으로 생성해주는 여러가지 프레임워크가 있다

주로 admin 관리자 패널을 만드는데 최적화된 패키지들이다

그 중 라라벨 공식사이트에서 추천하는 nova가 있는데 이건 라이센스를 구매해야 한다

 

오픈소스 무료인 것 중 비슷한 것으로 filament라는 프레임워크가 있다

현재 3.x 버전까지 나온 상태인데 spatie와 연동되는 플러그인도 쓸만한 것이 많다

 

그 중 라라벨의 ORM인 Eloquent의 연관관계(relationships)을 이용해

트리 구조의 테이블 필터나 폼을 만들 수 있는 플러그인이 있다

https://github.com/CodeWithDennis/filament-select-tree

 

GitHub - CodeWithDennis/filament-select-tree: The multi-level select field lets you pick one or multiple options from a list tha

The multi-level select field lets you pick one or multiple options from a list that is neatly organized into different levels. - GitHub - CodeWithDennis/filament-select-tree: The multi-level select...

github.com

 

설치해서 BelongsTo 또는 BelongsToMany 연관관계(relationships)를 맺어주면 아래와 같이 사용 가능하다

 

매뉴얼 중에 드롭다운을 펼치는 방향에 대한 옵션에 오타가 있어서 풀리퀘스트를 날려서 현재는 수정된 상태

https://github.com/CodeWithDennis/filament-select-tree/commit/94e5a7fde6dfae8eb2ba5e38a264e510dabc84bf

 

Fix typos · CodeWithDennis/filament-select-tree@94e5a7f

directon => direction

github.com

 

연관관계에 대한 라라벨코리아의 문서는 아래에서 볼 수 있다

https://laravel.kr/docs/9.x/eloquent-relationships

 

라라벨 9.x - Relationships-연관관계

라라벨 한글 메뉴얼 9.x - Relationships-연관관계

laravel.kr

 

filament 데모 페이지는 아래에서 볼 수 있다

https://demo.filamentphp.com/

 

Login - Filament Demo

 

demo.filamentphp.com

 

db 스키마와 model, resource를 포함한 샘플 저장소를 깃허브에 올려두었다

https://github.com/illlust/filament-select-tree-sample-app

 

GitHub - illlust/filament-select-tree-sample-app

Contribute to illlust/filament-select-tree-sample-app development by creating an account on GitHub.

github.com

 

Posted by illlust
,

부제: 윈도우에서 라라벨을 쓰고 싶어요

 

윈도우에서 %PATH% 경로에 php 추가 없이 extension 사용하기

아래 모듈에 추가적으로 필요한 dll 파일들을 아파치에서 직접 불러와야 한다

php_openssl.dll
php_intl.dll

# httpd.conf
LoadModule php_module "C:/php8/php8apache2_4.dll"

<IfModule php_module>
  # php.ini
  PHPIniDir "C:/php8" 
  # php_openssl.dll
  LoadFile "C:/php8/libcrypto-3-x64.dll" 
  LoadFile "C:/php8/libssh2.dll" 
  LoadFile "C:/php8/libssl-3-x64.dll" 
  LoadFile "C:/php8/nghttp2.dll" 
  LoadFile "C:/php8/php8ts.dll" 
  # php_intl.dll
  LoadFile "C:/php8/icudt71.dll" 
  LoadFile "C:/php8/icuin71.dll" 
  LoadFile "C:/php8/icuio71.dll" 
  LoadFile "C:/php8/icuuc71.dll"
</IfModule>

 

 

'php' 카테고리의 다른 글

filament-select-tree  (1) 2023.11.14
Posted by illlust
,