restaurant changes
This commit is contained in:
0
Modules/Ingredient/app/Http/Controllers/.gitkeep
Normal file
0
Modules/Ingredient/app/Http/Controllers/.gitkeep
Normal file
@ -0,0 +1,105 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Ingredient\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Modules\Ingredient\Models\IngredientCategory;
|
||||
use Modules\Ingredient\Repositories\IngredientCategoryRepository;
|
||||
|
||||
class IngredientCategoryController extends Controller
|
||||
{
|
||||
private $ingredientCategoryRepository;
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function __construct(
|
||||
IngredientCategoryRepository $ingredientCategoryRepository) {
|
||||
$this->ingredientCategoryRepository = $ingredientCategoryRepository;
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data['title'] = 'Categories List';
|
||||
$data['categories'] = $this->ingredientCategoryRepository->findAll();
|
||||
return view('ingredient::ingredientCategory.index', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$data['title'] = 'Create IngredientCategory';
|
||||
$data['status'] = IngredientCategory::STATUS;
|
||||
|
||||
return view('ingredient::ingredientCategory.create', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
$request->request->add(['slug' => slugify($request->title)]);
|
||||
$inputData = $request->all();
|
||||
$this->ingredientCategoryRepository->create($inputData);
|
||||
toastr()->success('IngredientCategory Created Succesfully');
|
||||
|
||||
return redirect()->route('ingredientCategory.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$data['title'] = 'Show IngredientCategory';
|
||||
$data['status'] = IngredientCategory::STATUS;
|
||||
$data['category'] = $this->ingredientCategoryRepository->getIngredientCategoryById($id);
|
||||
|
||||
return view('ingredient::ingredientCategory.show', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$data['title'] = 'Edit IngredientCategory';
|
||||
$data['status'] = IngredientCategory::STATUS;
|
||||
|
||||
$data['category'] = $this->ingredientCategoryRepository->getIngredientCategoryById($id);
|
||||
|
||||
return view('ingredient::ingredientCategory.edit', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id): RedirectResponse
|
||||
{
|
||||
$inputData = $request->except(['_method', '_token']);
|
||||
$this->ingredientCategoryRepository->update($id, $inputData);
|
||||
|
||||
return redirect()->route('ingredientCategory.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
try {
|
||||
$IngredientCategoryModel = $this->ingredientCategoryRepository->getIngredientCategoryById($id);
|
||||
$IngredientCategoryModel->delete();
|
||||
|
||||
toastr()->success('Ingredient Delete Succesfully');
|
||||
} catch (\Throwable $th) {
|
||||
toastr()->error($th->getMessage());
|
||||
}
|
||||
|
||||
return response()->json(['status' => true, 'message' => 'IngredientCategory Delete Succesfully']);
|
||||
}
|
||||
}
|
152
Modules/Ingredient/app/Http/Controllers/IngredientController.php
Normal file
152
Modules/Ingredient/app/Http/Controllers/IngredientController.php
Normal file
@ -0,0 +1,152 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Ingredient\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Modules\Ingredient\Models\Unit;
|
||||
use Modules\Ingredient\Models\Ingredient;
|
||||
use Modules\Ingredient\Repositories\IngredientCategoryRepository;
|
||||
use Modules\Ingredient\Repositories\UnitRepository;
|
||||
use Modules\Ingredient\Repositories\IngredientInterface;
|
||||
use Modules\Ingredient\Repositories\IngredientRepository;
|
||||
use Modules\Supplier\Models\Supplier;
|
||||
use Modules\Supplier\Repositories\SupplierRepository;
|
||||
|
||||
class IngredientController extends Controller
|
||||
{
|
||||
private $ingredientRepository;
|
||||
private $ingredientCategoryRepository;
|
||||
private $unitRepository;
|
||||
private $supplierRepository;
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function __construct(IngredientRepository $ingredientRepository,
|
||||
IngredientCategoryRepository $ingredientCategoryRepository,
|
||||
SupplierRepository $supplierRepository,
|
||||
UnitRepository $unitRepository)
|
||||
{
|
||||
$this->ingredientRepository = $ingredientRepository;
|
||||
$this->ingredientCategoryRepository = $ingredientCategoryRepository;
|
||||
$this->unitRepository = $unitRepository;
|
||||
$this->supplierRepository = $supplierRepository;
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data['title'] = "Ingredient Lists";
|
||||
$data['ingredients'] = $this->ingredientRepository->findAll();
|
||||
return view('ingredient::ingredient.index', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$data['title'] = 'Create Ingredient';
|
||||
$data['ingredientCategory'] = $this->ingredientCategoryRepository->pluck();
|
||||
$data['unit'] = $this->unitRepository->pluck();
|
||||
$data['supplier'] = $this->supplierRepository->pluck();
|
||||
$data['status'] = Ingredient::STATUS;
|
||||
|
||||
return view('ingredient::ingredient.create', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
$inputData = $request->all();
|
||||
$this->ingredientRepository->create($inputData);
|
||||
toastr()->success('Ingredient Created Succesfully');
|
||||
|
||||
return redirect()->route('ingredient.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$data['title'] = 'Show Ingredient';
|
||||
$data['ingredient'] = $this->ingredientRepository->getIngredientById($id);
|
||||
$data['status'] = Ingredient::STATUS;
|
||||
|
||||
return view('ingredient::ingredient.show', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$data['title'] = 'Show Ingredient';
|
||||
$data['ingredientCategory'] = $this->ingredientCategoryRepository->pluck();
|
||||
$data['unit'] = $this->unitRepository->pluck();
|
||||
$data['supplier'] = $this->supplierRepository->pluck();
|
||||
$data['ingredient'] = $this->ingredientRepository->getIngredientById($id);
|
||||
$data['status'] = Ingredient::STATUS;
|
||||
|
||||
return view('ingredient::ingredient.edit', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id): RedirectResponse
|
||||
{
|
||||
$inputData = $request->except(['_method', '_token']);
|
||||
$this->ingredientRepository->update($id, $inputData);
|
||||
|
||||
return redirect()->route('ingredient.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
try {
|
||||
$IngredientModel = $this->ingredientRepository->getIngredientById($id);
|
||||
$IngredientModel->delete();
|
||||
|
||||
toastr()->success('Ingredient Delete Succesfully');
|
||||
} catch (\Throwable $th) {
|
||||
toastr()->error($th->getMessage());
|
||||
}
|
||||
|
||||
return response()->json(['status' => true, 'message' => 'Ingredient Delete Succesfully']);
|
||||
}
|
||||
|
||||
public function getIngredientDetail(Request $request)
|
||||
{
|
||||
try {
|
||||
$ingredientModel = $this->ingredientRepository->getIngredientById($request->id);
|
||||
} catch (\Throwable $th) {
|
||||
toastr()->error($th->getMessage());
|
||||
|
||||
}
|
||||
return response()->json([
|
||||
'status' => true,
|
||||
'data' => $ingredientModel,
|
||||
]);
|
||||
}
|
||||
|
||||
public function getIngredientsByCategory(Request $request)
|
||||
{
|
||||
$ingredientCategoryId = $request->ingredient_category_id;
|
||||
try {
|
||||
$ingredients = $this->ingredientRepository->getIngredientsByCategory($ingredientCategoryId);
|
||||
} catch (\Throwable $th) {
|
||||
toastr()->error($th->getMessage());
|
||||
}
|
||||
return response()->json(['ingredients' => $ingredients]);
|
||||
}
|
||||
|
||||
|
||||
}
|
111
Modules/Ingredient/app/Http/Controllers/UnitController.php
Normal file
111
Modules/Ingredient/app/Http/Controllers/UnitController.php
Normal file
@ -0,0 +1,111 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Ingredient\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Modules\Ingredient\Models\Unit;
|
||||
use Modules\Ingredient\Repositories\UnitRepository;
|
||||
|
||||
class UnitController extends Controller
|
||||
{
|
||||
private $unitRepository;
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function __construct(
|
||||
UnitRepository $unitRepository)
|
||||
{
|
||||
$this->unitRepository = $unitRepository;
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data['title'] = 'Unit List';
|
||||
$data['units'] = $this->unitRepository->findAll();
|
||||
|
||||
return view('ingredient::unit.index', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$data['title'] = 'Create Unit';
|
||||
$data['status'] = Unit::STATUS;
|
||||
|
||||
return view('ingredient::unit.create', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
|
||||
$request->request->add(['slug' => slugify($request->title)]);
|
||||
$inputData = $request->all();
|
||||
$this->unitRepository->create($inputData);
|
||||
toastr()->success('Unit Created Succesfully');
|
||||
|
||||
return redirect()->route('unit.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$data['title'] = 'Show Fabric Category';
|
||||
$data['status'] = Unit::STATUS;
|
||||
$data['unit'] = $this->unitRepository->getUnitById($id);
|
||||
|
||||
return view('ingredient::unit.show', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$data['title'] = 'Edit Fabric Category';
|
||||
$data['status'] = Unit::STATUS;
|
||||
$data['unit'] = $this->unitRepository->getUnitById($id);
|
||||
|
||||
return view('ingredient::unit.edit', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id): RedirectResponse
|
||||
{
|
||||
$inputData = $request->except(['_method', '_token']);
|
||||
$this->unitRepository->update($id, $inputData);
|
||||
|
||||
return redirect()->route('unit.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
try {
|
||||
$UnitModel = $this->unitRepository->getUnitById($id);
|
||||
$UnitModel->delete();
|
||||
|
||||
toastr()->success('Fabric Category Delete Succesfully');
|
||||
} catch (\Throwable $th) {
|
||||
toastr()->error($th->getMessage());
|
||||
}
|
||||
|
||||
return response()->json(['status' => true, 'message' => 'Fabric Category Delete Succesfully']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
0
Modules/Ingredient/app/Http/Requests/.gitkeep
Normal file
0
Modules/Ingredient/app/Http/Requests/.gitkeep
Normal file
0
Modules/Ingredient/app/Models/.gitkeep
Normal file
0
Modules/Ingredient/app/Models/.gitkeep
Normal file
33
Modules/Ingredient/app/Models/Ingredient.php
Normal file
33
Modules/Ingredient/app/Models/Ingredient.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Ingredient\Models;
|
||||
|
||||
use App\Traits\StatusTrait;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Modules\Supplier\Models\Supplier;
|
||||
|
||||
class Ingredient extends Model
|
||||
{
|
||||
USE StatusTrait;
|
||||
|
||||
protected $table = 'tbl_ingredients';
|
||||
protected $guarded = [];
|
||||
protected $appends = ['status_name'];
|
||||
|
||||
|
||||
public function category()
|
||||
{
|
||||
return $this->belongsTo(IngredientCategory::class, 'ingredient_category_id');
|
||||
}
|
||||
|
||||
public function unit()
|
||||
{
|
||||
return $this->belongsTo(Unit::class, 'unit_id');
|
||||
}
|
||||
|
||||
|
||||
public function supplier()
|
||||
{
|
||||
return $this->belongsTo(Supplier::class, 'supplier_id');
|
||||
}
|
||||
}
|
16
Modules/Ingredient/app/Models/IngredientCategory.php
Normal file
16
Modules/Ingredient/app/Models/IngredientCategory.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Ingredient\Models;
|
||||
|
||||
use App\Traits\StatusTrait;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class IngredientCategory extends Model
|
||||
{
|
||||
USE StatusTrait;
|
||||
|
||||
protected $table = 'tbl_ingredient_categories';
|
||||
protected $guarded = [];
|
||||
protected $appends = ['status_name'];
|
||||
|
||||
}
|
16
Modules/Ingredient/app/Models/Unit.php
Normal file
16
Modules/Ingredient/app/Models/Unit.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Ingredient\Models;
|
||||
|
||||
use App\Traits\StatusTrait;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Unit extends Model
|
||||
{
|
||||
USE StatusTrait;
|
||||
|
||||
protected $table = 'tbl_units';
|
||||
protected $guarded = [];
|
||||
protected $appends = ['status_name'];
|
||||
|
||||
}
|
0
Modules/Ingredient/app/Observers/.gitkeep
Normal file
0
Modules/Ingredient/app/Observers/.gitkeep
Normal file
0
Modules/Ingredient/app/Providers/.gitkeep
Normal file
0
Modules/Ingredient/app/Providers/.gitkeep
Normal file
32
Modules/Ingredient/app/Providers/EventServiceProvider.php
Normal file
32
Modules/Ingredient/app/Providers/EventServiceProvider.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Ingredient\Providers;
|
||||
|
||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||
|
||||
class EventServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The event handler mappings for the application.
|
||||
*
|
||||
* @var array<string, array<int, string>>
|
||||
*/
|
||||
protected $listen = [];
|
||||
|
||||
/**
|
||||
* Indicates if events should be discovered.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected static $shouldDiscoverEvents = true;
|
||||
|
||||
/**
|
||||
* Configure the proper event listeners for email verification.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function configureEmailVerification(): void
|
||||
{
|
||||
|
||||
}
|
||||
}
|
120
Modules/Ingredient/app/Providers/IngredientServiceProvider.php
Normal file
120
Modules/Ingredient/app/Providers/IngredientServiceProvider.php
Normal file
@ -0,0 +1,120 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Ingredient\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class IngredientServiceProvider extends ServiceProvider
|
||||
{
|
||||
protected string $moduleName = 'Ingredient';
|
||||
|
||||
protected string $moduleNameLower = 'ingredient';
|
||||
|
||||
/**
|
||||
* Boot the application events.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
$this->registerCommands();
|
||||
$this->registerCommandSchedules();
|
||||
$this->registerTranslations();
|
||||
$this->registerConfig();
|
||||
$this->registerViews();
|
||||
$this->loadMigrationsFrom(module_path($this->moduleName, 'database/migrations'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the service provider.
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
$this->app->register(EventServiceProvider::class);
|
||||
$this->app->register(RouteServiceProvider::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register commands in the format of Command::class
|
||||
*/
|
||||
protected function registerCommands(): void
|
||||
{
|
||||
// $this->commands([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register command Schedules.
|
||||
*/
|
||||
protected function registerCommandSchedules(): void
|
||||
{
|
||||
// $this->app->booted(function () {
|
||||
// $schedule = $this->app->make(Schedule::class);
|
||||
// $schedule->command('inspire')->hourly();
|
||||
// });
|
||||
}
|
||||
|
||||
/**
|
||||
* Register translations.
|
||||
*/
|
||||
public function registerTranslations(): void
|
||||
{
|
||||
$langPath = resource_path('lang/modules/'.$this->moduleNameLower);
|
||||
|
||||
if (is_dir($langPath)) {
|
||||
$this->loadTranslationsFrom($langPath, $this->moduleNameLower);
|
||||
$this->loadJsonTranslationsFrom($langPath);
|
||||
} else {
|
||||
$this->loadTranslationsFrom(module_path($this->moduleName, 'lang'), $this->moduleNameLower);
|
||||
$this->loadJsonTranslationsFrom(module_path($this->moduleName, 'lang'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register config.
|
||||
*/
|
||||
protected function registerConfig(): void
|
||||
{
|
||||
$this->publishes([module_path($this->moduleName, 'config/config.php') => config_path($this->moduleNameLower.'.php')], 'config');
|
||||
$this->mergeConfigFrom(module_path($this->moduleName, 'config/config.php'), $this->moduleNameLower);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register views.
|
||||
*/
|
||||
public function registerViews(): void
|
||||
{
|
||||
$viewPath = resource_path('views/modules/'.$this->moduleNameLower);
|
||||
$sourcePath = module_path($this->moduleName, 'resources/views');
|
||||
|
||||
$this->publishes([$sourcePath => $viewPath], ['views', $this->moduleNameLower.'-module-views']);
|
||||
|
||||
$this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower);
|
||||
|
||||
$componentNamespace = str_replace('/', '\\', config('modules.namespace').'\\'.$this->moduleName.'\\'.ltrim(config('modules.paths.generator.component-class.path'), config('modules.paths.app_folder', '')));
|
||||
Blade::componentNamespace($componentNamespace, $this->moduleNameLower);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the services provided by the provider.
|
||||
*
|
||||
* @return array<string>
|
||||
*/
|
||||
public function provides(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string>
|
||||
*/
|
||||
private function getPublishableViewPaths(): array
|
||||
{
|
||||
$paths = [];
|
||||
foreach (config('view.paths') as $path) {
|
||||
if (is_dir($path.'/modules/'.$this->moduleNameLower)) {
|
||||
$paths[] = $path.'/modules/'.$this->moduleNameLower;
|
||||
}
|
||||
}
|
||||
|
||||
return $paths;
|
||||
}
|
||||
}
|
49
Modules/Ingredient/app/Providers/RouteServiceProvider.php
Normal file
49
Modules/Ingredient/app/Providers/RouteServiceProvider.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Ingredient\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||
|
||||
class RouteServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Called before routes are registered.
|
||||
*
|
||||
* Register any model bindings or pattern based filters.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
parent::boot();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the routes for the application.
|
||||
*/
|
||||
public function map(): void
|
||||
{
|
||||
$this->mapApiRoutes();
|
||||
|
||||
$this->mapWebRoutes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "web" routes for the application.
|
||||
*
|
||||
* These routes all receive session state, CSRF protection, etc.
|
||||
*/
|
||||
protected function mapWebRoutes(): void
|
||||
{
|
||||
Route::middleware('web')->group(module_path('Ingredient', '/routes/web.php'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "api" routes for the application.
|
||||
*
|
||||
* These routes are typically stateless.
|
||||
*/
|
||||
protected function mapApiRoutes(): void
|
||||
{
|
||||
Route::middleware('api')->prefix('api')->name('api.')->group(module_path('Ingredient', '/routes/api.php'));
|
||||
}
|
||||
}
|
0
Modules/Ingredient/app/Repositories/.gitkeep
Normal file
0
Modules/Ingredient/app/Repositories/.gitkeep
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Ingredient\Repositories;
|
||||
|
||||
interface IngredientCategoryInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getIngredientCategoryById($IngredientCategoryId);
|
||||
public function getIngredientCategoryByEmail($email);
|
||||
public function delete($IngredientCategoryId);
|
||||
public function create($IngredientCategoryDetails);
|
||||
public function update($IngredientCategoryId, array $newDetails);
|
||||
public function pluck();
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Ingredient\Repositories;
|
||||
|
||||
use Modules\Ingredient\Models\IngredientCategory;
|
||||
|
||||
class IngredientCategoryRepository implements IngredientCategoryInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return IngredientCategory::when(true, function ($query) {
|
||||
|
||||
})->paginate(20);
|
||||
}
|
||||
|
||||
public function getIngredientCategoryById($IngredientCategoryId)
|
||||
{
|
||||
return IngredientCategory::findOrFail($IngredientCategoryId);
|
||||
}
|
||||
|
||||
public function getIngredientCategoryByEmail($email)
|
||||
{
|
||||
return IngredientCategory::where('email', $email)->first();
|
||||
}
|
||||
|
||||
public function delete($IngredientCategoryId)
|
||||
{
|
||||
IngredientCategory::destroy($IngredientCategoryId);
|
||||
}
|
||||
|
||||
public function create($IngredientCategoryDetails)
|
||||
{
|
||||
return IngredientCategory::create($IngredientCategoryDetails);
|
||||
}
|
||||
|
||||
public function update($IngredientCategoryId, array $newDetails)
|
||||
{
|
||||
return IngredientCategory::whereId($IngredientCategoryId)->update($newDetails);
|
||||
}
|
||||
|
||||
public function pluck()
|
||||
{
|
||||
return IngredientCategory::pluck('title', 'id');
|
||||
}
|
||||
|
||||
}
|
16
Modules/Ingredient/app/Repositories/IngredientInterface.php
Normal file
16
Modules/Ingredient/app/Repositories/IngredientInterface.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Ingredient\Repositories;
|
||||
|
||||
interface IngredientInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getIngredientById($IngredientId);
|
||||
public function getIngredientByEmail($email);
|
||||
public function getIngredientsByCategory($categoryId);
|
||||
public function delete($IngredientId);
|
||||
public function create($IngredientDetails);
|
||||
public function update($IngredientId, array $newDetails);
|
||||
public function pluck();
|
||||
|
||||
}
|
52
Modules/Ingredient/app/Repositories/IngredientRepository.php
Normal file
52
Modules/Ingredient/app/Repositories/IngredientRepository.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Ingredient\Repositories;
|
||||
|
||||
use Modules\Ingredient\Models\Ingredient;
|
||||
|
||||
class IngredientRepository implements IngredientInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return Ingredient::when(true, function ($query) {
|
||||
|
||||
})->paginate(20);
|
||||
}
|
||||
|
||||
public function getIngredientById($IngredientId)
|
||||
{
|
||||
return Ingredient::findOrFail($IngredientId);
|
||||
}
|
||||
|
||||
public function getIngredientByEmail($email)
|
||||
{
|
||||
return Ingredient::where('email', $email)->first();
|
||||
}
|
||||
|
||||
public function getIngredientsByCategory($ingredientCategoryId)
|
||||
{
|
||||
return Ingredient::where('ingredient_category_id', $ingredientCategoryId)->pluck('name', 'id');
|
||||
}
|
||||
|
||||
public function delete($IngredientId)
|
||||
{
|
||||
Ingredient::destroy($IngredientId);
|
||||
}
|
||||
|
||||
public function create($IngredientDetails)
|
||||
{
|
||||
return Ingredient::create($IngredientDetails);
|
||||
}
|
||||
|
||||
public function update($IngredientId, array $newDetails)
|
||||
{
|
||||
return Ingredient::whereId($IngredientId)->update($newDetails);
|
||||
}
|
||||
|
||||
public function pluck()
|
||||
{
|
||||
return Ingredient::pluck('name', 'id');
|
||||
}
|
||||
|
||||
}
|
||||
|
15
Modules/Ingredient/app/Repositories/UnitInterface.php
Normal file
15
Modules/Ingredient/app/Repositories/UnitInterface.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Ingredient\Repositories;
|
||||
|
||||
interface UnitInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getUnitById($UnitId);
|
||||
public function getUnitByEmail($email);
|
||||
public function delete($UnitId);
|
||||
public function create($UnitDetails);
|
||||
public function update($UnitId, array $newDetails);
|
||||
public function pluck();
|
||||
|
||||
}
|
46
Modules/Ingredient/app/Repositories/UnitRepository.php
Normal file
46
Modules/Ingredient/app/Repositories/UnitRepository.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Ingredient\Repositories;
|
||||
|
||||
use Modules\Ingredient\Models\Unit;
|
||||
|
||||
class UnitRepository implements UnitInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return Unit::when(true, function ($query) {
|
||||
|
||||
})->paginate(20);
|
||||
}
|
||||
|
||||
public function getUnitById($UnitId)
|
||||
{
|
||||
return Unit::findOrFail($UnitId);
|
||||
}
|
||||
|
||||
public function getUnitByEmail($email)
|
||||
{
|
||||
return Unit::where('email', $email)->first();
|
||||
}
|
||||
|
||||
public function delete($UnitId)
|
||||
{
|
||||
Unit::destroy($UnitId);
|
||||
}
|
||||
|
||||
public function create($UnitDetails)
|
||||
{
|
||||
return Unit::create($UnitDetails);
|
||||
}
|
||||
|
||||
public function update($UnitId, array $newDetails)
|
||||
{
|
||||
return Unit::whereId($UnitId)->update($newDetails);
|
||||
}
|
||||
|
||||
public function pluck()
|
||||
{
|
||||
return Unit::pluck('title', 'id');
|
||||
}
|
||||
|
||||
}
|
30
Modules/Ingredient/composer.json
Normal file
30
Modules/Ingredient/composer.json
Normal file
@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "nwidart/ingredient",
|
||||
"description": "",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Widart",
|
||||
"email": "n.widart@gmail.com"
|
||||
}
|
||||
],
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [],
|
||||
"aliases": {
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Modules\\Ingredient\\": "app/",
|
||||
"Modules\\Ingredient\\Database\\Factories\\": "database/factories/",
|
||||
"Modules\\Ingredient\\Database\\Seeders\\": "database/seeders/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Modules\\Ingredient\\Tests\\": "tests/"
|
||||
}
|
||||
}
|
||||
}
|
0
Modules/Ingredient/config/.gitkeep
Normal file
0
Modules/Ingredient/config/.gitkeep
Normal file
5
Modules/Ingredient/config/config.php
Normal file
5
Modules/Ingredient/config/config.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'name' => 'Ingredient',
|
||||
];
|
0
Modules/Ingredient/database/factories/.gitkeep
Normal file
0
Modules/Ingredient/database/factories/.gitkeep
Normal file
0
Modules/Ingredient/database/migrations/.gitkeep
Normal file
0
Modules/Ingredient/database/migrations/.gitkeep
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('tbl_ingredient_categories', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('title');
|
||||
$table->string('code')->nullable();
|
||||
$table->string('slug')->nullable();
|
||||
$table->integer('status')->default(11);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('tbl_ingredient_categories');
|
||||
}
|
||||
};
|
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('tbl_ingredients', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('code');
|
||||
$table->longText('desc')->nullable();
|
||||
$table->longText('remarks')->nullable();
|
||||
$table->decimal('price', 10, 2)->nullable();
|
||||
$table->integer('qty')->nullable();
|
||||
$table->unsignedBigInteger('ingredient_category_id')->nullable();
|
||||
$table->unsignedBigInteger('supplier_id')->nullable();
|
||||
$table->unsignedBigInteger('warehouse_id')->nullable();
|
||||
$table->integer('status')->default(11);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('tbl_ingredients');
|
||||
}
|
||||
};
|
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::create('tbl_units', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('title')->nullable();
|
||||
$table->string('code')->nullable();
|
||||
$table->string('slug')->nullable();
|
||||
$table->text('description')->nullable();
|
||||
$table->integer('display_order')->nullable();
|
||||
$table->integer('status')->default(11);
|
||||
$table->text('remarks')->nullable();
|
||||
$table->dateTime('created_at')->nullable();
|
||||
$table->integer('createdby')->nullable();
|
||||
$table->dateTime('updated_at')->nullable();
|
||||
$table->integer('updatedby')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('tbl_masterunits');
|
||||
}
|
||||
};
|
0
Modules/Ingredient/database/seeders/.gitkeep
Normal file
0
Modules/Ingredient/database/seeders/.gitkeep
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Ingredient\Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class IngredientDatabaseSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// $this->call([]);
|
||||
}
|
||||
}
|
11
Modules/Ingredient/module.json
Normal file
11
Modules/Ingredient/module.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "Ingredient",
|
||||
"alias": "ingredient",
|
||||
"description": "",
|
||||
"keywords": [],
|
||||
"priority": 0,
|
||||
"providers": [
|
||||
"Modules\\Ingredient\\Providers\\IngredientServiceProvider"
|
||||
],
|
||||
"files": []
|
||||
}
|
15
Modules/Ingredient/package.json
Normal file
15
Modules/Ingredient/package.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"axios": "^1.1.2",
|
||||
"laravel-vite-plugin": "^0.7.5",
|
||||
"sass": "^1.69.5",
|
||||
"postcss": "^8.3.7",
|
||||
"vite": "^4.0.0"
|
||||
}
|
||||
}
|
0
Modules/Ingredient/resources/assets/.gitkeep
Normal file
0
Modules/Ingredient/resources/assets/.gitkeep
Normal file
0
Modules/Ingredient/resources/assets/js/app.js
Normal file
0
Modules/Ingredient/resources/assets/js/app.js
Normal file
0
Modules/Ingredient/resources/assets/sass/app.scss
Normal file
0
Modules/Ingredient/resources/assets/sass/app.scss
Normal file
0
Modules/Ingredient/resources/views/.gitkeep
Normal file
0
Modules/Ingredient/resources/views/.gitkeep
Normal file
7
Modules/Ingredient/resources/views/index.blade.php
Normal file
7
Modules/Ingredient/resources/views/index.blade.php
Normal file
@ -0,0 +1,7 @@
|
||||
@extends('ingredient::layouts.master')
|
||||
|
||||
@section('content')
|
||||
<h1>Hello World</h1>
|
||||
|
||||
<p>Module: {!! config('ingredient.name') !!}</p>
|
||||
@endsection
|
@ -0,0 +1,27 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
|
||||
{{ html()->form('POST')->route('ingredient.store')->class(['needs-validation'])->attributes(['novalidate', 'enctype' => 'multipart/form-data'])->open() }}
|
||||
|
||||
@include('ingredient::ingredient.partials.action')
|
||||
|
||||
{{ html()->form()->close() }}
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
|
||||
<script>
|
||||
function validateNumericInput(input) {
|
||||
// Allow only numbers and remove any non-numeric input
|
||||
input.value = input.value.replace(/[^0-9.]/g, '');
|
||||
input.value = input.value.replace(/(\..*)\./g, '$1');
|
||||
input.value = input.value.replace(/^(\d+)(\.\d{0,2})?.*/, '$1$2');
|
||||
}
|
||||
</script>
|
||||
@endpush
|
30
Modules/Ingredient/resources/views/ingredient/edit.blade.php
Normal file
30
Modules/Ingredient/resources/views/ingredient/edit.blade.php
Normal file
@ -0,0 +1,30 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
<!-- end page title -->
|
||||
|
||||
{{ html()->modelForm($ingredient, 'PUT')->route('ingredient.update', $ingredient->id)->class(['needs-validation'])->attributes(['novalidate', 'enctype' => 'multipart/form-data'])->open() }}
|
||||
@include('ingredient::ingredient.partials.action')
|
||||
{{ html()->closeModelForm() }}
|
||||
<!--end row-->
|
||||
|
||||
</div>
|
||||
<!-- container-fluid -->
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
|
||||
<script>
|
||||
function validateNumericInput(input) {
|
||||
// Allow only numbers and remove any non-numeric input
|
||||
input.value = input.value.replace(/[^0-9.]/g, '');
|
||||
input.value = input.value.replace(/(\..*)\./g, '$1');
|
||||
input.value = input.value.replace(/^(\d+)(\.\d{0,2})?.*/, '$1$2');
|
||||
}
|
||||
</script>
|
||||
@endpush
|
@ -0,0 +1,74 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
|
||||
|
||||
<div class="mb-2 text-end">
|
||||
@can('ingredient.create')
|
||||
<a href="{{ route('ingredient.create') }}" class="btn btn-success btn-md waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Add</a>
|
||||
@endcan
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table id="buttons-datatables" class="display table-sm table-bordered table" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>S.N</th>
|
||||
<th>Title</th>
|
||||
{{-- <th>Fabric Category</th> --}}
|
||||
<th>Ingredient Category</th>
|
||||
<th>Ingredient Code</th>
|
||||
<th>Status</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($ingredients as $key => $ingredient)
|
||||
{{-- @dd($ingredient->fabricCategory) --}}
|
||||
<tr>
|
||||
<td>{{ $key + 1 }}</td>
|
||||
<td>{{ $ingredient->name }}</td>
|
||||
{{-- <td>{{ optional($ingredient->fabricCategory)->title }}</td> --}}
|
||||
<td>{{ optional($ingredient->category)->title }}</td>
|
||||
<td>{{ $ingredient->code }}</td>
|
||||
<td>{!! $ingredient->status_name !!}</td>
|
||||
<td>
|
||||
<div class="hstack flex-wrap gap-3">
|
||||
@can('ingredient.show')
|
||||
<a href="{{ route('ingredient.show', $ingredient->id) }}" class="link-info fs-15">
|
||||
<i class="ri-eye-line"></i>
|
||||
</a>
|
||||
@endcan
|
||||
@can('ingredient.edit')
|
||||
<a href="{{ route('ingredient.edit', $ingredient->id) }}"
|
||||
class="link-success fs-15 edit-item-btn"><i class="ri-edit-2-line"></i></a>
|
||||
@endcan
|
||||
@can('ingredient.destroy')
|
||||
<a href="javascript:void(0);" data-link="{{ route('ingredient.destroy', $ingredient->id) }}"
|
||||
data-id="{{ $ingredient->id }}" class="link-danger fs-15 remove-item-btn"><i
|
||||
class="ri-delete-bin-line"></i></a>
|
||||
@endcan
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--end row-->
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
@ -0,0 +1,89 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-9">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row gy-1">
|
||||
<div class="col-md-6">
|
||||
{{ html()->label('Ingredient Name')->class('form-label') }}
|
||||
{{ html()->text('name')->class('form-control')->placeholder('Enter Ingredient Name')->required() }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{{ html()->label('Ingredient Code')->class('form-label') }}
|
||||
{{ html()->text('code')->class('form-control')->placeholder('Enter Ingredient Code')->required() }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{{ html()->label('Category')->class('form-label') }}
|
||||
{{ html()->select('ingredient_category_id', $ingredientCategory)->class('form-select select2')->placeholder('Select Category')->id('ingredient_category_id') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{{ html()->label('Price')->class('form-label') }}
|
||||
{{ html()->text('price')->class('form-control product-price cleave-numeral rate~~')->placeholder('Enter Price')->attributes(['onkeyup' => 'validateNumericInput(this)'])->required() }}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
{{ html()->label('Description')->class('form-label') }}
|
||||
{{ html()->textarea('desc')->class('form-control')->placeholder('Enter Description') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
{{ html()->label('Remarks')->class('form-label') }}
|
||||
{{ html()->textarea('remarks')->class('form-control')->placeholder('Enter Remarks') }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- end card -->
|
||||
</div>
|
||||
<!-- end card -->
|
||||
|
||||
</div>
|
||||
<div class="mb-3 text-end">
|
||||
<a href="{{ route('ingredient.index') }}" class="btn btn-danger w-sm">Cancel</a>
|
||||
<button type="submit" class="btn btn-success w-sm">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end col -->
|
||||
<div class="col-lg-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title mb-0">Publish</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{{ html()->label('Status')->class('form-label') }}
|
||||
{{ html()->select('status', $status)->class('form-control')->placeholder('Select Status')->required() }}
|
||||
</div>
|
||||
</div>
|
||||
<!-- end card -->
|
||||
</div>
|
||||
<!-- end col -->
|
||||
</div>
|
||||
|
||||
@push('js')
|
||||
{{-- <script>
|
||||
$(document).on('change', '#category_id', function(e) {
|
||||
e.preventDefault();
|
||||
var category_id = $(this).val();
|
||||
if (category_id) {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "{{ route('getSubCategories') }}" ,
|
||||
data: {
|
||||
'category_id': category_id
|
||||
},
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
$('#sub_category_id').html('<option value="#" selected disabled>Select Sub Category</option>');
|
||||
$.each(response.message, function(key, value) {
|
||||
$('#sub_category_id').append('<option value=' + value.id + '>' + value.title + '</option>');
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script> --}}
|
||||
@endpush
|
57
Modules/Ingredient/resources/views/ingredient/show.blade.php
Normal file
57
Modules/Ingredient/resources/views/ingredient/show.blade.php
Normal file
@ -0,0 +1,57 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card card-body p-4">
|
||||
<div>
|
||||
<div class="table-responsive">
|
||||
<table class="table-borderless mb-0 table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><span class="fw-medium">Ingredient Name</span></th>
|
||||
<td>{{ $ingredient->name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><span class="fw-medium">Ingredient Code</span></th>
|
||||
<td>{{ $ingredient->code }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><span class="fw-medium">Category</span></th>
|
||||
<td>{{ optional($ingredient->category)->title }}</td>
|
||||
</tr>
|
||||
{{-- <tr>
|
||||
<th><span class="fw-medium">Fabric Category</span></th>
|
||||
<td>{{ optional($ingredient->fabricCategory)->title }}</td>
|
||||
</tr> --}}
|
||||
<tr>
|
||||
<th><span class="fw-medium">Description</span></th>
|
||||
<td>{{ optional($ingredient->desc) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><span class="fw-medium">Status</span></th>
|
||||
<td>{{ $ingredient->status }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3 text-end">
|
||||
<a href="{{ route('ingredient.index') }}" class="btn btn-secondary w-sm">Back</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
|
||||
@endpush
|
@ -0,0 +1,18 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
|
||||
{{ html()->form('POST')->route('ingredientCategory.store')->class(['needs-validation'])->attributes(['novalidate', 'enctype' => 'multipart/form-data'])->open() }}
|
||||
@include('ingredient::ingredientCategory.partials.action')
|
||||
{{ html()->form()->close() }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
|
||||
@endpush
|
@ -0,0 +1,22 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
<!-- end page title -->
|
||||
|
||||
{{ html()->modelForm($ingredientCategory, 'PUT')->route('ingredientCategory.update', $ingredientCategory->id)->class(['needs-validation'])->attributes(['novalidate', 'enctype' => 'multipart/form-data'])->open() }}
|
||||
@include('ingredient::ingredientCategory.partials.action')
|
||||
{{ html()->closeModelForm() }}
|
||||
<!--end row-->
|
||||
|
||||
</div>
|
||||
<!-- container-fluid -->
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
|
||||
@endpush
|
@ -0,0 +1,71 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
|
||||
|
||||
<div class="mb-2 text-end">
|
||||
@can('ingredientCategory.create')
|
||||
<a href="{{ route('ingredientCategory.create') }}" class="btn btn-success btn-md waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Add</a>
|
||||
@endcan
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table id="buttons-datatables" class="display table-sm table-bordered table" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>S.N</th>
|
||||
<th>Title</th>
|
||||
<th>Code</th>
|
||||
<th>Slug</th>
|
||||
<th>Status</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($categories as $key => $ingredientCategory)
|
||||
<tr>
|
||||
<td>{{ $key + 1 }}</td>
|
||||
<td>{{ $ingredientCategory->title }}</td>
|
||||
<td>{{ $ingredientCategory->code }}</td>
|
||||
<td>{{ $ingredientCategory->slug }}</td>
|
||||
<td>{!! $ingredientCategory->status_name !!}</td>
|
||||
<td>
|
||||
<div class="hstack flex-wrap gap-3">
|
||||
@can('ingredientCategory.show')
|
||||
<a href="{{ route('ingredientCategory.show', $ingredientCategory->id) }}" class="link-info fs-15">
|
||||
<i class="ri-eye-line"></i>
|
||||
</a>
|
||||
@endcan
|
||||
@can('ingredientCategory.edit')
|
||||
<a href="{{ route('ingredientCategory.edit', $ingredientCategory->id) }}"
|
||||
class="link-success fs-15 edit-item-btn"><i class="ri-edit-2-line"></i></a>
|
||||
@endcan
|
||||
@can('ingredientCategory.destroy')
|
||||
<a href="javascript:void(0);" data-link="{{ route('ingredientCategory.destroy', $ingredientCategory->id) }}"
|
||||
data-id="{{ $ingredientCategory->id }}" class="link-danger fs-15 remove-item-btn"><i
|
||||
class="ri-delete-bin-line"></i></a>
|
||||
@endcan
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--end row-->
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
@ -0,0 +1,51 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row gy-1">
|
||||
|
||||
<div class="col-md-6">
|
||||
{{ html()->label('Title')->class('form-label') }}
|
||||
{{ html()->text('title')->class('form-control')->placeholder('Enter Title')->required() }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{{ html()->label('Code')->class('form-label') }}
|
||||
{{ html()->text('code')->class('form-control')->placeholder('Enter Code') }}
|
||||
</div>
|
||||
|
||||
<!-- <div class="col-md-6">
|
||||
{{ html()->label('Slug')->class('form-label') }}
|
||||
{{ html()->text('slug')->class('form-control')->placeholder('Enter Slug') }}
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- end card -->
|
||||
<div class="mb-3 text-end">
|
||||
<a href="{{ route('ingredientCategory.index') }}" class="btn btn-danger w-sm">Cancel</a>
|
||||
<button type="submit" class="btn btn-success w-sm">Save</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- end col -->
|
||||
<div class="col-lg-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title mb-0">Publish</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{{ html()->label('Status')->class('form-label') }}
|
||||
{{ html()->select('status', $status)->class('form-control')->placeholder('Enter Status')->required() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end card body -->
|
||||
</div>
|
||||
<!-- end card -->
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,49 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card card-body p-4">
|
||||
<div>
|
||||
<div class="table-responsive">
|
||||
<table class="table-borderless mb-0 table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><span class="fw-medium">Ingredient Category</span></th>
|
||||
<td>{{ $ingredientCategory->title }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><span class="fw-medium">Code</span></th>
|
||||
<td>{{ $ingredientCategory->code }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><span class="fw-medium">Slug</span></th>
|
||||
<td>{{ $ingredientCategory->slug }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><span class="fw-medium">Status</span></th>
|
||||
<td>{{ $ingredientCategory->status }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3 text-end">
|
||||
<a href="{{ route('ingredientCategory.index') }}" class="btn btn-secondary w-sm">Back</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
|
||||
@endpush
|
29
Modules/Ingredient/resources/views/layouts/master.blade.php
Normal file
29
Modules/Ingredient/resources/views/layouts/master.blade.php
Normal file
@ -0,0 +1,29 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
|
||||
<title>Ingredient Module - {{ config('app.name', 'Laravel') }}</title>
|
||||
|
||||
<meta name="description" content="{{ $description ?? '' }}">
|
||||
<meta name="keywords" content="{{ $keywords ?? '' }}">
|
||||
<meta name="author" content="{{ $author ?? '' }}">
|
||||
|
||||
<!-- Fonts -->
|
||||
<link rel="preconnect" href="https://fonts.bunny.net">
|
||||
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />
|
||||
|
||||
{{-- Vite CSS --}}
|
||||
{{-- {{ module_vite('build-ingredient', 'resources/assets/sass/app.scss') }} --}}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@yield('content')
|
||||
|
||||
{{-- Vite JS --}}
|
||||
{{-- {{ module_vite('build-ingredient', 'resources/assets/js/app.js') }} --}}
|
||||
</body>
|
16
Modules/Ingredient/resources/views/unit/create.blade.php
Normal file
16
Modules/Ingredient/resources/views/unit/create.blade.php
Normal file
@ -0,0 +1,16 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
{{ html()->form('POST')->route('unit.store')->class(['needs-validation'])->attributes(['novalidate', 'enctype' => 'multipart/form-data'])->open() }}
|
||||
@include('ingredient::unit.partials.action')
|
||||
{{ html()->form()->close() }}
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
|
||||
@endpush
|
23
Modules/Ingredient/resources/views/unit/edit.blade.php
Normal file
23
Modules/Ingredient/resources/views/unit/edit.blade.php
Normal file
@ -0,0 +1,23 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
<!-- end page title -->
|
||||
|
||||
{{ html()->modelForm($unit, 'PUT')->route('unit.update', $fabric_category->id)->class(['needs-validation'])->attributes(['novalidate', 'enctype' => 'multipart/form-data'])->open() }}
|
||||
|
||||
@include('ingredient::unit.partials.action')
|
||||
|
||||
{{ html()->closeModelForm() }}
|
||||
|
||||
</div>
|
||||
<!-- container-fluid -->
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
|
||||
@endpush
|
72
Modules/Ingredient/resources/views/unit/index.blade.php
Normal file
72
Modules/Ingredient/resources/views/unit/index.blade.php
Normal file
@ -0,0 +1,72 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
|
||||
|
||||
<div class="mb-2 text-end">
|
||||
@can('unit.create')
|
||||
<a href="{{ route('unit.create') }}" class="btn btn-success btn-md waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Add</a>
|
||||
@endcan
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table id="buttons-datatables" class="display table-sm table-bordered table" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>S.N</th>
|
||||
<th>Title</th>
|
||||
<th>Slug</th>
|
||||
<th>Code</th>
|
||||
<th>Status</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($units as $key => $unit)
|
||||
<tr>
|
||||
<td>{{ $key + 1 }}</td>
|
||||
<td>{{ $unit->title }}</td>
|
||||
<td>{{ $unit->slug }}</td>
|
||||
<td>{{ $unit->code }}</td>
|
||||
<td>{!! $unit->status_name !!}</td>
|
||||
<td>
|
||||
<div class="hstack flex-wrap gap-3">
|
||||
@can('unit.show')
|
||||
<a href="{{ route('unit.show', $unit->id) }}" class="link-info fs-15">
|
||||
<i class="ri-eye-line"></i>
|
||||
</a>
|
||||
@endcan
|
||||
@can('unit.edit')
|
||||
<a href="{{ route('unit.edit', $unit->id) }}"
|
||||
class="link-success fs-15 edit-item-btn"><i class="ri-edit-2-line"></i></a>
|
||||
@endcan
|
||||
@can('unit.destroy')
|
||||
<a href="javascript:void(0);"
|
||||
data-link="{{ route('unit.destroy', $unit->id) }}"
|
||||
data-id="{{ $unit->id }}" class="link-danger fs-15 remove-item-btn"><i
|
||||
class="ri-delete-bin-line"></i></a>
|
||||
@endcan
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--end row-->
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
@ -0,0 +1,60 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row gy-1">
|
||||
|
||||
<div class="col-md-6">
|
||||
{{ html()->label('Title')->class('form-label') }}
|
||||
{{ html()->text('title')->class('form-control')->placeholder('Enter Title')->required() }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{{ html()->label('code')->class('form-label') }}
|
||||
{{ html()->text('code')->class('form-control')->placeholder('Enter code')->required() }}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
{{ html()->label('Description')->class('form-label') }}
|
||||
{{ html()->text('description')->class('form-control')->placeholder('Enter Description') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
{{ html()->label('Remarks')->class('form-label') }}
|
||||
{{ html()->text('remarks')->class('form-control')->placeholder('Enter Remarks') }}
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end card -->
|
||||
<div class="mb-3 text-end">
|
||||
<a href="{{ route('unit.index') }}" class="btn btn-danger w-sm">Cancel</a>
|
||||
<button type="submit" class="btn btn-success w-sm">Save</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- end col -->
|
||||
<div class="col-lg-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title mb-0">Publish</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{{ html()->label('Status')->class('form-label') }}
|
||||
{{-- {{ html()->select('status', '11')->class('form-control')->placeholder('Select Status') }}
|
||||
--}}
|
||||
{{ html()->select('status', $status)->class('form-control')->placeholder('Select Status')->required() }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end card body -->
|
||||
</div>
|
||||
<!-- end card -->
|
||||
</div>
|
||||
</div>
|
49
Modules/Ingredient/resources/views/unit/show.blade.php
Normal file
49
Modules/Ingredient/resources/views/unit/show.blade.php
Normal file
@ -0,0 +1,49 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card card-body p-4">
|
||||
<div>
|
||||
<div class="table-responsive">
|
||||
<table class="table-borderless mb-0 table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><span class="fw-medium">Title</span></th>
|
||||
<td>{{ $unit->title }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><span class="fw-medium">Code</span></th>
|
||||
<td>{{ $unit->code }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><span class="fw-medium">Description</span></th>
|
||||
<td>{{ $unit->description }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><span class="fw-medium">Remarks</span></th>
|
||||
<td>{{ $unit->remarks }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3 text-end">
|
||||
<a href="{{ route('fabricCategory.index') }}" class="btn btn-secondary w-sm">Back</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
|
||||
@endpush
|
0
Modules/Ingredient/routes/.gitkeep
Normal file
0
Modules/Ingredient/routes/.gitkeep
Normal file
19
Modules/Ingredient/routes/api.php
Normal file
19
Modules/Ingredient/routes/api.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Modules\Ingredient\Http\Controllers\IngredientController;
|
||||
|
||||
/*
|
||||
*--------------------------------------------------------------------------
|
||||
* API Routes
|
||||
*--------------------------------------------------------------------------
|
||||
*
|
||||
* Here is where you can register API routes for your application. These
|
||||
* routes are loaded by the RouteServiceProvider within a group which
|
||||
* is assigned the "api" middleware group. Enjoy building your API!
|
||||
*
|
||||
*/
|
||||
|
||||
Route::middleware(['auth:sanctum'])->prefix('v1')->group(function () {
|
||||
Route::apiResource('ingredient', IngredientController::class)->names('ingredient');
|
||||
});
|
27
Modules/Ingredient/routes/web.php
Normal file
27
Modules/Ingredient/routes/web.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Modules\Ingredient\Http\Controllers\IngredientCategoryController;
|
||||
use Modules\Ingredient\Http\Controllers\IngredientController;
|
||||
use Modules\Ingredient\Http\Controllers\UnitController;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Web Routes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here is where you can register web routes for your application. These
|
||||
| routes are loaded by the RouteServiceProvider within a group which
|
||||
| contains the "web" middleware group. Now create something great!
|
||||
|
|
||||
*/
|
||||
|
||||
Route::group([], function () {
|
||||
Route::resource('ingredient', IngredientController::class)->names('ingredient');
|
||||
Route::resource('ingredientCategory', IngredientCategoryController::class)->names('ingredientCategory');
|
||||
Route::resource('unit', UnitController::class)->names('unit');
|
||||
Route::get('ingredient-details', [IngredientController::class, 'getIngredientDetail'])->name('get-ingredient-detail');
|
||||
Route::get('/ingredients-by-category', [IngredientController::class, 'getIngredientsByCategory'])->name('ingredients-by-category');
|
||||
|
||||
|
||||
});
|
26
Modules/Ingredient/vite.config.js
Normal file
26
Modules/Ingredient/vite.config.js
Normal file
@ -0,0 +1,26 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import laravel from 'laravel-vite-plugin';
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
outDir: '../../public/build-ingredient',
|
||||
emptyOutDir: true,
|
||||
manifest: true,
|
||||
},
|
||||
plugins: [
|
||||
laravel({
|
||||
publicDirectory: '../../public',
|
||||
buildDirectory: 'build-ingredient',
|
||||
input: [
|
||||
__dirname + '/resources/assets/sass/app.scss',
|
||||
__dirname + '/resources/assets/js/app.js'
|
||||
],
|
||||
refresh: true,
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
//export const paths = [
|
||||
// 'Modules/Ingredient/resources/assets/sass/app.scss',
|
||||
// 'Modules/Ingredient/resources/assets/js/app.js',
|
||||
//];
|
Reference in New Issue
Block a user