Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

akaunting/akaunting

9348 stars
2 code files
View akaunting/akaunting on GitHub

app/Http/ViewComposers/Modules.php

Open in GitHub
class Modules
{
public function compose(View $view)
{
if (setting('apps.api_key')) {
$categories = Cache::remember('modules.categories.' . language()->getShortCode(), Date::now()->addHour(6), function () {
return collect($this->getCategoriesOfModules())->pluck('name', 'slug')
->prepend(trans('general.all_type', ['type' => trans_choice('general.categories', 2)]), '*');
});
} else {
$categories = collect([
'*' => trans('general.all_type', ['type' => trans_choice('general.categories', 2)]),
]);
}
 
$view->with(['categories' => $categories]);
}
}

app/Http/Controllers/Common/Companies.php

Open in GitHub
use App\Models\Common\Company;
use App\Models\Setting\Currency;
 
class Companies extends Controller
{
public function edit(Company $company)
{
if ($this->isNotUserCompany($company->id)) {
return redirect()->route('companies.index');
}
 
$currencies = Currency::enabled()->pluck('name', 'code');
 
return view('common.companies.edit', compact('company', 'currencies'));
}
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.