-
app/Http/Controllers/Settings/Modules.php
Open in GitHubuse App\Abstracts\Http\Controller; use App\Models\Banking\Account; use App\Models\Setting\Category; use App\Models\Setting\Setting; class Modules extends Controller { // public function edit($alias) { $accounts = Account::enabled()->orderBy('name')->pluck('name', 'id'); $categories = Category::income()->enabled()->orderBy('name')->pluck('name', 'id'); $setting = Setting::prefix($alias)->get()->transform(function ($s) use ($alias) { $s->key = str_replace($alias . '.', '', $s->key); return $s; })->pluck('value', 'key'); $module = module($alias); return view('settings.modules.edit', compact('setting', 'module', 'accounts', 'categories')); } // }