Enhance solution management features: add title_description and bullets fields to SolutionResource, update OurSolutionPageController to fetch solutions in descending order, and create new views for displaying solutions with detailed descriptions and bullet points. Adjust CSS for active button styling and update navigation to reflect title instead of name for solutions.
This commit is contained in:
1 parent
e2323c7949
commit
1b4989b440
8 files changed
+212
-4
No files matched your search
@@ -28,12 +28,30 @@ public static function form(Form $form): Form
|
||||
->maxLength(255)
|
||||
->reactive()
|
||||
->afterStateUpdated(fn (string $operation, $state, Forms\Set $set) => $operation === 'create' ? $set('slug', Str::slug($state)) : null),
|
||||
Forms\Components\TextInput::make('slug')
|
||||
|
||||
Forms\Components\TextInput::make('slug')
|
||||
->required()
|
||||
->maxLength(255),
|
||||
|
||||
Forms\Components\TextInput::make('title_description')
|
||||
->maxLength(255)
|
||||
->required()
|
||||
->columnSpanFull(),
|
||||
|
||||
Forms\Components\Repeater::make('bullets')
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('bullet')
|
||||
->label('Bullet Point')
|
||||
->required(),
|
||||
])
|
||||
->columns(1)
|
||||
->columnSpanFull()
|
||||
->createItemButtonLabel('Add Bullet Point')
|
||||
->defaultItems(1),
|
||||
Forms\Components\RichEditor::make('description')
|
||||
->required()
|
||||
->columnSpanFull(),
|
||||
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ class OurSolutionPageController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$solutions = Solution::all();
|
||||
$solutions = Solution::query()->latest()->get();
|
||||
|
||||
return view('web.pages.our-solutions.index', compact('solutions'));
|
||||
}
|
||||
|
||||
@@ -13,5 +13,11 @@ class Solution extends Model
|
||||
'title',
|
||||
'description',
|
||||
'slug',
|
||||
'title_description',
|
||||
'bullets',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'bullets' => 'array',
|
||||
];
|
||||
}
|
||||
Reference in new issue
Block a user