Refactor views to use new layout structure and update routes for administrator pages
- Changed view extends from "admin.main" to "administrator.layout.master" across multiple files. - Updated route names in admin.php and administrator.php to reflect new structure for user, order, invoice, and other management functionalities. - Adjusted view includes to point to the new directory structure for blocks and components. - Ensured all permission checks remain intact while refactoring the views.
This commit is contained in:
@@ -19,7 +19,7 @@ class UserController extends Controller
|
||||
$title = 'Administrators';
|
||||
$users = User::with('roles')->paginate(15);
|
||||
|
||||
return view('admin.user.index', compact('title', 'users'));
|
||||
return view('administrator.pages.user.index', compact('title', 'users'));
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
@@ -96,7 +96,7 @@ class UserController extends Controller
|
||||
DB::rollBack();
|
||||
return back()->withErrors($exception->getMessage());
|
||||
}
|
||||
return redirect()->route('admin.user.index')->with('success', 'New account added successfully');
|
||||
return redirect()->route('administrator.pages.user.index')->with('success', 'New account added successfully');
|
||||
}
|
||||
|
||||
public function create()
|
||||
@@ -104,7 +104,7 @@ class UserController extends Controller
|
||||
$roles = Role::select('name')->get();
|
||||
$title = "Add new Administrator";
|
||||
|
||||
return view('admin.user.add', compact('roles', 'title'));
|
||||
return view('administrator.pages.user.add', compact('roles', 'title'));
|
||||
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ class UserController extends Controller
|
||||
$roles = Role::select('name')->get();
|
||||
$title = 'Edit admin information';
|
||||
|
||||
return view('admin.user.edit', compact('user', 'title', 'roles'));
|
||||
return view('administrator.pages.user.edit', compact('user', 'title', 'roles'));
|
||||
}
|
||||
|
||||
public function update(Request $request)
|
||||
|
||||
Reference in New Issue
Block a user