-
app/Http/Controllers/DatabaseController.php
Open in GitHubuse App\Jobs\InstallDatabase; use App\Jobs\InstallDatabaseUser; use App\Models\Server; use Illuminate\Http\Request; use Illuminate\Support\Facades\Bus; use ProtoneMedia\Splade\Facades\Toast; class DatabaseController extends Controller { // ... public function store(Server $server, Request $request) { // ... Bus::chain([ new InstallDatabase($database, $this->user()->fresh()), new InstallDatabaseUser($databaseUser, $data['password'], $this->user()->fresh()), ])->dispatch(); Toast::message(__('The database and user will be created shortly.')); return to_route('servers.databases.index', $server); } // ... }