File tree Expand file tree Collapse file tree 3 files changed +30
-14
lines changed Expand file tree Collapse file tree 3 files changed +30
-14
lines changed Original file line number Diff line number Diff line change @@ -33,11 +33,18 @@ public function definition(): array
3333 'google_analytic_code ' => '<script></script> ' ,
3434 'google_adsense_code ' => '<script></script> ' ,
3535 'quick_links ' => [
36- $ this ->faker ->word => $ this ->faker ->url (),
37-
38- $ this ->faker ->word => $ this ->faker ->url (),
39-
40- $ this ->faker ->word => $ this ->faker ->url ()
36+ [
37+ 'label ' => 'Home ' ,
38+ 'url ' => $ this ->faker ->url ,
39+ ],
40+ [
41+ 'label ' => 'About ' ,
42+ 'url ' => $ this ->faker ->url ,
43+ ],
44+ [
45+ 'label ' => 'Contact ' ,
46+ 'url ' => $ this ->faker ->url ,
47+ ],
4148 ],
4249 ];
4350 }
Original file line number Diff line number Diff line change 185185 </div >
186186 <div class =" flex flex-col items-start gap-3 py-3 text-sm font-medium" >
187187 <h4 class =" text-xl font-semibold" >Quick Links</h4 >
188- @forelse ($setting -> quick_links ?? [] as $title => $ link )
189- <a href =" {{ $link } }"
188+ @forelse ($setting -> quick_links ?? [] as $link )
189+ <a href =" {{ $link [ ' url ' ] } }"
190190 class =" transition duration-300 will-change-transform hover:translate-x-1 hover:text-black motion-reduce:transition-none motion-reduce:hover:transform-none" >
191- {{ $title } }
191+ {{ $link [ ' label ' ] } }
192192 </a >
193193 @empty
194194 <p class =" text-gray-300 font-semibold" >No links found</p >
Original file line number Diff line number Diff line change 44
55use Filament \Forms \Components \FileUpload ;
66use Filament \Forms \Components \KeyValue ;
7+ use Filament \Forms \Components \Repeater ;
78use Filament \Forms \Components \Section ;
89use Filament \Forms \Components \Textarea ;
910use Filament \Forms \Components \TextInput ;
@@ -85,12 +86,20 @@ public static function getForm(): array
8586 Section::make ('Quick Links ' )
8687 ->description ('Add your quick links here. This will be displayed in the footer of your blog. ' )
8788 ->schema ([
88- KeyValue::make ('quick_links ' )
89- ->label ('Please add full url with http or https. ' )
90- ->keyLabel ('Title ' )
91- ->valueLabel ('URL ' )
92- ->columnSpanFull (),
93- ])->columns (2 ),
89+ Repeater::make ('quick_links ' )
90+ ->label ('Links ' )
91+ ->schema ([
92+ TextInput::make ('label ' )
93+ ->required ()
94+ ->maxLength (155 ),
95+ TextInput::make ('url ' )
96+ ->label ('URL ' )
97+ ->helperText ('URL should start with http:// or https:// ' )
98+ ->required ()
99+ ->url ()
100+ ->maxLength (255 ),
101+ ])->columns (2 ),
102+ ])->columnSpanFull (),
94103 ];
95104 }
96105}
You can’t perform that action at this time.
0 commit comments