- 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\Users;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Http\Requests\Admin\Users\StoreUserRequest;
|
|
use App\Services\UserService;
|
|
|
|
class UserStoreController extends Controller
|
|
{
|
|
/**
|
|
* Store a newly created resource in storage.
|
|
*/
|
|
public function __invoke(StoreUserRequest $request, UserService $userService)
|
|
{
|
|
if ($userService->store($request->validated())) {
|
|
return redirect()->route('admin.users.index')->with('status', 'User created successfully.');
|
|
}
|
|
|
|
return redirect()->back()->withInput()->with('error', 'Failed to create user.');
|
|
}
|
|
}
|