Laravel 12 Tutorial #70 | Product Filters (IX) | Column Re-ordering | Column Visibility | Roles
Автор: Stack Developers
Загружено: 2025-08-21
Просмотров: 167
🔗Laravel 12 Multi-Vendor E-commerce Series Complete Playlist:
• Laravel 12 Multi-Vendor E-commerce
Welcome to Part 70 of our Laravel 12 Multi-Vendor E-commerce Tutorial Series, where we’re building a complete, professional Multi-Vendor E-commerce Website from scratch.
In this part, we will integrate the datatable, column reordering, column visibility, and roles & permissions features into both the Filters and Filter Values modules in the admin panel.
1) scripts.blade.php — update tablesConfig
Add filters and filters_values to the global tablesConfig used by the DataTables init script so both modules will (a) restore saved column order and hidden columns on load and (b) reuse the same column-reorder / column-visibility save listeners that already exist for categories and products. This avoids duplicating init code.
2) FilterController@index (update)
Mirror the products flow — fetch data + permission info from service, then load the admin's saved column preferences from the column_preferences table and pass them to the view as $filtersSavedOrder and $filtersHiddenCols. Also pass $title so the blade heading doesn't break.
3) FilterService::getAll() (update)
Bring FilterService response shape in line with ProductService::products() so controller/view expectations match. Also enforce the same admin/subadmin permission logic so blades can use $filtersModule['view_access'], edit_access, full_access.
i) Fetch all filters (with relations if needed)
ii) Set Admin/Subadmin Permissions for Filters
iii) Return the same structure as ProductService
4. Protect UI actions based on $filtersModule permissions: Add button and Edit/Delete/Toggle status appear only if admin has edit_access or full_access (delete only for full_access).
Manage Values link shows only if user has at least view_access. Table id filters matches scripts.blade.php config so DataTables order/visibility will apply.
5) FilterValueController@index (update)
Ensure the view receives the parent $filter, the correct variable name $filterValues (matching the blade), permission array $filtersValuesModule, and the saved preference vars for DataTables. Accept $filterId so the list is scoped to that filter.
6) FilterValueService::getAll($filterId) (update)
Return filter-values list plus permission details using the same pattern as products/filters so controller + blade can make consistent checks and behavior.
7) resources/views/admin/filter_values/index.blade.php (update)
Apply the same permission checks to Filter Values UI: Add/Edit/Delete buttons are shown only for users with edit_access/full_access (delete only on full_access). Table id="filters_values" ties into scripts.blade.php so saved order & hidden columns are applied and persisted.
📢 Don’t forget to Like, Share & Subscribe for more Laravel tutorials! 🚀
🔗Bookmark & follow this Laravel 12 Multi-Vendor E-commerce Series:
• Laravel 12 Multi-Vendor E-commerce
►Click here to subscribe for Laravel & other updates - / stackdevelopers
Popular Stack Developers Series that can help you:-
►Laravel 12 Tutorial (with MySQL): • Laravel 12 Tutorial
►Laravel 11 Tutorial (with MongoDB): • Laravel 11 Tutorial (with MongoDB)
►Laravel 11 PostgreSQL Tutorial: • Laravel PostgreSQL Tutorial
►Laravel API Tutorial - • Laravel API Tutorial | Create API from Scr...
►jQuery Tutorial - • jQuery Tutorial
►Laravel Basic E-commerce Series - • Make Admin Panel / E-commerce Website in L...
►Laravel Dating Series - • Make Dating / Social Networking Website in...
►Join this channel to get the complete source code of all series:
/ @stackdevelopers
Follow Stack Developers on Social Media to get updates and resolve your queries
►Like Facebook Page to get updates - / stackdevelopers2
►Join Facebook Group to resolve your queries - / stackdevelopers
►Follow on Instagram - / stackdevelopers2
►Follow on GitHub - https://github.com/stackdevelopers
#Laravel12 #LaravelEcommerce #MultiVendor #EcommerceDevelopment #WebDevelopment #LaravelTutorial

Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: