- AP-09 Produktbestand inkl. Bewegungshistorie (product_stock_movements, ProductStockService) - AP-10 Rohstoffbestand-Ansicht je Lager (RawMaterialStockController) - AP-11 Bestandsschwellen / Out-of-Stock-Handling fuer Produkte und Shop - AP-12 Ausgang/Ausschuss (stock_disposals, StockDisposalController, InventoryService) - Set-Produkte (product_set_items) inkl. Aufloesung - Produktentwicklung & Hinweise-Verwaltung (Notices) - AP-13 Entwicklungskonzept Shop-Bestandsabzug im Plan dokumentiert - Feature-Tests fuer neue Module + aktualisierter Entwicklungsplan Co-authored-by: Cursor <cursoragent@cursor.com>
51 lines
1.4 KiB
PHP
51 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Services\InventoryService;
|
|
use App\Services\ProductStockService;
|
|
use Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider;
|
|
use Illuminate\Support\Facades\Schema;
|
|
use Illuminate\Support\Facades\URL;
|
|
use Illuminate\Support\Facades\View;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Bootstrap any application services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function boot()
|
|
{
|
|
Schema::defaultStringLength(191);
|
|
URL::forceScheme('https');
|
|
|
|
View::composer('layouts.includes.layout-sidenav', function ($view): void {
|
|
$criticalIngredients = 0;
|
|
$criticalProducts = 0;
|
|
$user = auth()->user();
|
|
if ($user && $user->isCopyReader()) {
|
|
$criticalIngredients = app(InventoryService::class)->criticalIngredientCount();
|
|
$criticalProducts = app(ProductStockService::class)->criticalProductCount();
|
|
}
|
|
$view->with('criticalIngredientCount', $criticalIngredients);
|
|
$view->with('criticalProductCount', $criticalProducts);
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Register any application services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function register()
|
|
{
|
|
|
|
if ($this->app->environment() !== 'production') {
|
|
$this->app->register(IdeHelperServiceProvider::class);
|
|
}
|
|
// ...
|
|
}
|
|
}
|