- Added standard Laravel directory structure and configuration. - Included Svelte and Tailwind configuration for the admin interface. - Added core PHPUnit and testing scripts.
23 lines
644 B
PHP
23 lines
644 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Admin\Roles;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Http\Requests\Admin\Roles\StoreRoleRequest;
|
|
use App\Services\RoleService;
|
|
|
|
class RoleStoreController extends Controller
|
|
{
|
|
/**
|
|
* Store a newly created resource in storage.
|
|
*/
|
|
public function __invoke(StoreRoleRequest $request, RoleService $roleService)
|
|
{
|
|
if ($roleService->store($request->validated())) {
|
|
return redirect()->route('admin.roles.index')->with('status', 'Role created successfully.');
|
|
}
|
|
|
|
return redirect()->back()->withInput()->with('error', 'Failed to create role.');
|
|
}
|
|
}
|