first commit
This commit is contained in:
0
Modules/Asset/app/Http/Controllers/.gitkeep
Normal file
0
Modules/Asset/app/Http/Controllers/.gitkeep
Normal file
102
Modules/Asset/app/Http/Controllers/AssetCategoryController.php
Normal file
102
Modules/Asset/app/Http/Controllers/AssetCategoryController.php
Normal file
@ -0,0 +1,102 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Asset\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Modules\Admin\Services\AdminService;
|
||||
use Modules\Asset\Repositories\AssetCategoryInterface;
|
||||
use Modules\Employee\Repositories\EmployeeRepository;
|
||||
|
||||
class AssetCategoryController extends Controller
|
||||
{
|
||||
private $assetCategoryRepository;
|
||||
private $adminService;
|
||||
private $employeeRepository;
|
||||
|
||||
|
||||
|
||||
public function __construct(AssetCategoryInterface $assetCategoryRepository, AdminService $adminService, EmployeeRepository $employeeRepository)
|
||||
{
|
||||
$this->assetCategoryRepository = $assetCategoryRepository;
|
||||
$this->adminService = $adminService;
|
||||
$this->employeeRepository = $employeeRepository;
|
||||
|
||||
|
||||
}
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$data['title'] = "Asset Category Lists";
|
||||
$data['assetCategoryLists'] = $this->assetCategoryRepository->findAll();
|
||||
return view('asset::assetcategories.index', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$data['title'] = "Create AssetCategory";
|
||||
$data['editable'] = false;
|
||||
$data['assetCategoryLists'] = $this->assetCategoryRepository->pluck();
|
||||
$data['departmentList'] = $this->adminService->pluckDepartments();
|
||||
$data['employeeList'] = $this->employeeRepository->pluck();
|
||||
|
||||
|
||||
|
||||
|
||||
return view('asset::assetCategories.create', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
$this->assetCategoryRepository->create($request->all());
|
||||
toastr()->success('AssetCategory Created Successfully.');
|
||||
return redirect()->route('assetCategory.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
return view('asset::assetcategories.show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$data['title'] = "Edit AssetCategory";
|
||||
$data['editable'] = true;
|
||||
$data['assetCategory'] = $this->assetCategoryRepository->getAssetCategoryById($id);
|
||||
return view('asset::assetcategories.edit', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id): RedirectResponse
|
||||
{
|
||||
$this->assetCategoryRepository->update($id, $request->all());
|
||||
toastr()->success('AssetCategory Updated Successfully.');
|
||||
return redirect()->route('assetCategory.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
98
Modules/Asset/app/Http/Controllers/AssetController.php
Normal file
98
Modules/Asset/app/Http/Controllers/AssetController.php
Normal file
@ -0,0 +1,98 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Asset\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Modules\Asset\Repositories\AssetCategoryInterface;
|
||||
use Modules\Asset\Repositories\AssetCategoryRepository;
|
||||
use Modules\Asset\Repositories\AssetInterface;
|
||||
use Modules\Asset\Repositories\AssetRepository;
|
||||
use Modules\Employee\Repositories\EmployeeRepository;
|
||||
|
||||
class AssetController extends Controller
|
||||
{
|
||||
private $assetRepository;
|
||||
private $assetCategoryRepository;
|
||||
private $employeeRepository;
|
||||
|
||||
|
||||
|
||||
public function __construct(AssetInterface $assetRepository, AssetCategoryInterface $assetCategoryRepository, EmployeeRepository $employeeRepository)
|
||||
{
|
||||
$this->assetRepository = $assetRepository;
|
||||
$this->assetCategoryRepository = $assetCategoryRepository;
|
||||
$this->employeeRepository = $employeeRepository;
|
||||
}
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$data['title'] = "Asset Lists";
|
||||
$data['assetLists'] = $this->assetRepository->findAll();
|
||||
return view('asset::assets.index', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$data['title'] = "Create Asset";
|
||||
$data['editable'] = false;
|
||||
$data['assetCategoryLists'] = $this->assetCategoryRepository->pluck();
|
||||
$data['employeeList'] = $this->employeeRepository->pluck();
|
||||
return view('asset::assets.create', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
$this->assetRepository->create($request->all());
|
||||
toastr()->success('Asset Created Successfully.');
|
||||
return redirect()->route('asset.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
return view('asset::assets.show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$data['title'] = "Edit Asset";
|
||||
$data['editable'] = true;
|
||||
$data['assetCategoryLists'] = $this->assetCategoryRepository->pluck();
|
||||
$data['asset'] = $this->assetRepository->getAssetById($id);
|
||||
return view('asset::assets.edit', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id): RedirectResponse
|
||||
{
|
||||
$this->assetRepository->update($id, $request->all());
|
||||
toastr()->success('Asset Updated Successfully.');
|
||||
return redirect()->route('asset.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
91
Modules/Asset/app/Http/Controllers/AssetDemandController.php
Normal file
91
Modules/Asset/app/Http/Controllers/AssetDemandController.php
Normal file
@ -0,0 +1,91 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\asset\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Modules\Asset\Repositories\AssetDemandInterface;
|
||||
use Modules\Asset\Repositories\AssetDemandRepository;
|
||||
use Modules\Asset\Repositories\AssetInterface;
|
||||
use Modules\Asset\Repositories\AssetRepository;
|
||||
|
||||
class AssetDemandController extends Controller
|
||||
{
|
||||
private $assetDemandRepository;
|
||||
private $assetRepository;
|
||||
|
||||
public function __construct(AssetDemandInterface $assetDemandRepository, AssetInterface $assetRepository)
|
||||
{
|
||||
$this->assetDemandRepository = $assetDemandRepository;
|
||||
$this->assetRepository = $assetRepository;
|
||||
}
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$data['title'] = "AssetDemand Lists";
|
||||
$data['assetDemandLists'] = $this->assetDemandRepository->findAll();
|
||||
return view('asset::assetdemands.index', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$data['title'] = "Create assetDemand";
|
||||
$data['editable'] = false;
|
||||
$data['availableAssetLists'] = $this->assetRepository->pluckAvailable();
|
||||
return view('asset::assetdemands.create', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
$this->assetDemandRepository->create($request->all());
|
||||
toastr()->success('assetDemand Created Successfully.');
|
||||
return redirect()->route('assetDemand.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
return view('asset::assetdemands.show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$data['title'] = "Edit assetDemand";
|
||||
$data['editable'] = true;
|
||||
$data['assetDemand'] = $this->assetDemandRepository->getassetDemandById($id);
|
||||
return view('asset::assetdemands.edit', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id): RedirectResponse
|
||||
{
|
||||
$this->assetDemandRepository->update($id, $request->all());
|
||||
toastr()->success('assetDemand Updated Successfully.');
|
||||
return redirect()->route('assetDemand.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
0
Modules/Asset/app/Http/Requests/.gitkeep
Normal file
0
Modules/Asset/app/Http/Requests/.gitkeep
Normal file
0
Modules/Asset/app/Models/.gitkeep
Normal file
0
Modules/Asset/app/Models/.gitkeep
Normal file
58
Modules/Asset/app/Models/Asset.php
Normal file
58
Modules/Asset/app/Models/Asset.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Asset\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Asset\Database\factories\AssetFactory;
|
||||
use Modules\Employee\Models\Employee;
|
||||
|
||||
class Asset extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'tbl_assets';
|
||||
protected $primaryKey = 'asset_id';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'asset_category_id',
|
||||
'name',
|
||||
'purchased_date',
|
||||
'purchased_from',
|
||||
'manufacturer',
|
||||
'model',
|
||||
'serial_number',
|
||||
'supplier',
|
||||
'condition',
|
||||
'warranty',
|
||||
'value',
|
||||
'asset_user',
|
||||
'status',
|
||||
'description',
|
||||
'remarks',
|
||||
'is_available',
|
||||
'approved_date',
|
||||
'approved_by',
|
||||
'createdBy',
|
||||
'updatedBy',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'is_available' => 'boolean',
|
||||
];
|
||||
|
||||
public function assetCategory(){
|
||||
return $this->belongsTo(AssetCategory::class,'asset_category_id');
|
||||
}
|
||||
|
||||
public function employee(){
|
||||
return $this->belongsTo(Employee::class,'asset_user');
|
||||
}
|
||||
|
||||
public function approver(){
|
||||
return $this->belongsTo(Employee::class,'approved_by');
|
||||
}
|
||||
|
||||
}
|
24
Modules/Asset/app/Models/AssetCategory.php
Normal file
24
Modules/Asset/app/Models/AssetCategory.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Asset\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Asset\Database\factories\AssetCategoryFactory;
|
||||
|
||||
class AssetCategory extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'tbl_asset_categories';
|
||||
protected $primaryKey = 'asset_category_id';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'status',
|
||||
'description',
|
||||
'remarks'
|
||||
];
|
||||
}
|
31
Modules/Asset/app/Models/AssetDemand.php
Normal file
31
Modules/Asset/app/Models/AssetDemand.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Asset\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Asset\Database\factories\AssetDemandFactory;
|
||||
|
||||
class AssetDemand extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'tbl_asset_demands';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'department_id',
|
||||
'designation_id',
|
||||
'employee_id',
|
||||
'asset_id',
|
||||
'request_date',
|
||||
'status',
|
||||
'reason',
|
||||
'description',
|
||||
'remarks',
|
||||
'createdby',
|
||||
'updatedBy'
|
||||
];
|
||||
}
|
0
Modules/Asset/app/Observers/.gitkeep
Normal file
0
Modules/Asset/app/Observers/.gitkeep
Normal file
0
Modules/Asset/app/Providers/.gitkeep
Normal file
0
Modules/Asset/app/Providers/.gitkeep
Normal file
124
Modules/Asset/app/Providers/AssetServiceProvider.php
Normal file
124
Modules/Asset/app/Providers/AssetServiceProvider.php
Normal file
@ -0,0 +1,124 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Asset\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Modules\Asset\Repositories\AssetCategoryInterface;
|
||||
use Modules\Asset\Repositories\AssetCategoryRepository;
|
||||
use Modules\Asset\Repositories\AssetDemandInterface;
|
||||
use Modules\Asset\Repositories\AssetDemandRepository;
|
||||
use Modules\Asset\Repositories\AssetInterface;
|
||||
use Modules\Asset\Repositories\AssetRepository;
|
||||
|
||||
|
||||
class AssetServiceProvider extends ServiceProvider
|
||||
{
|
||||
protected string $moduleName = 'Asset';
|
||||
|
||||
protected string $moduleNameLower = 'asset';
|
||||
|
||||
/**
|
||||
* 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(RouteServiceProvider::class);
|
||||
$this->app->bind(AssetDemandInterface::class, AssetDemandRepository::class);
|
||||
$this->app->bind(AssetInterface::class, AssetRepository::class);
|
||||
$this->app->bind(AssetCategoryInterface::class, AssetCategoryRepository::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.
|
||||
*/
|
||||
public function provides(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
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/Asset/app/Providers/RouteServiceProvider.php
Normal file
49
Modules/Asset/app/Providers/RouteServiceProvider.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Asset\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('Asset', '/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('Asset', '/routes/api.php'));
|
||||
}
|
||||
}
|
0
Modules/Asset/app/Repositories/.gitkeep
Normal file
0
Modules/Asset/app/Repositories/.gitkeep
Normal file
13
Modules/Asset/app/Repositories/AssetCategoryInterface.php
Normal file
13
Modules/Asset/app/Repositories/AssetCategoryInterface.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Asset\Repositories;
|
||||
|
||||
interface AssetCategoryInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function pluck();
|
||||
public function getAssetCategoryById($assetCategoryId);
|
||||
public function delete($assetCategoryId);
|
||||
public function create(array $assetCategoryDetails);
|
||||
public function update($assetCategoryId, array $newDetails);
|
||||
}
|
39
Modules/Asset/app/Repositories/AssetCategoryRepository.php
Normal file
39
Modules/Asset/app/Repositories/AssetCategoryRepository.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Asset\Repositories;
|
||||
|
||||
use Modules\Asset\Models\AssetCategory;
|
||||
|
||||
|
||||
class AssetCategoryRepository implements AssetCategoryInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return AssetCategory::get();
|
||||
}
|
||||
|
||||
public function getAssetCategoryById($assetCategoryId)
|
||||
{
|
||||
return AssetCategory::findOrFail($assetCategoryId);
|
||||
}
|
||||
|
||||
public function delete($assetCategoryId)
|
||||
{
|
||||
AssetCategory::destroy($assetCategoryId);
|
||||
}
|
||||
|
||||
public function create(array $assetCategoryDetails)
|
||||
{
|
||||
return AssetCategory::create($assetCategoryDetails);
|
||||
}
|
||||
|
||||
public function update($assetCategoryId, array $newDetails)
|
||||
{
|
||||
return AssetCategory::where('asset_category_id', $assetCategoryId)->update($newDetails);
|
||||
}
|
||||
|
||||
public function pluck(){
|
||||
return AssetCategory::pluck('name','asset_category_id');
|
||||
}
|
||||
|
||||
}
|
12
Modules/Asset/app/Repositories/AssetDemandInterface.php
Normal file
12
Modules/Asset/app/Repositories/AssetDemandInterface.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Asset\Repositories;
|
||||
|
||||
interface AssetDemandInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getAssetDemandById($assetDemandId);
|
||||
public function delete($assetDemandId);
|
||||
public function create(array $assetDemandDetails);
|
||||
public function update($assetDemandId, array $newDetails);
|
||||
}
|
36
Modules/Asset/app/Repositories/AssetDemandRepository.php
Normal file
36
Modules/Asset/app/Repositories/AssetDemandRepository.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Asset\Repositories;
|
||||
|
||||
use Modules\Asset\Models\AssetDemand;
|
||||
use Modules\Asset\Repositories\AssetDemandInterface;
|
||||
|
||||
|
||||
class AssetDemandRepository implements AssetDemandInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return AssetDemand::get();
|
||||
}
|
||||
|
||||
public function getAssetDemandById($assetDemandId)
|
||||
{
|
||||
return AssetDemand::findOrFail($assetDemandId);
|
||||
}
|
||||
|
||||
public function delete($assetDemandId)
|
||||
{
|
||||
AssetDemand::destroy($assetDemandId);
|
||||
}
|
||||
|
||||
public function create(array $assetDemandDetails)
|
||||
{
|
||||
return AssetDemand::create($assetDemandDetails);
|
||||
}
|
||||
|
||||
public function update($assetDemandId, array $newDetails)
|
||||
{
|
||||
return AssetDemand::where('id', $assetDemandId)->update($newDetails);
|
||||
}
|
||||
|
||||
}
|
13
Modules/Asset/app/Repositories/AssetInterface.php
Normal file
13
Modules/Asset/app/Repositories/AssetInterface.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Asset\Repositories;
|
||||
|
||||
interface AssetInterface
|
||||
{
|
||||
public function pluckAvailable();
|
||||
public function findAll();
|
||||
public function getAssetById($assetId);
|
||||
public function delete($assetId);
|
||||
public function create(array $assetDetails);
|
||||
public function update($assetId, array $newDetails);
|
||||
}
|
40
Modules/Asset/app/Repositories/AssetRepository.php
Normal file
40
Modules/Asset/app/Repositories/AssetRepository.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Asset\Repositories;
|
||||
|
||||
use Modules\Asset\Models\Asset;
|
||||
|
||||
|
||||
class AssetRepository implements AssetInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return Asset::get();
|
||||
}
|
||||
|
||||
public function getAssetById($assetId)
|
||||
{
|
||||
return Asset::findOrFail($assetId);
|
||||
}
|
||||
|
||||
public function delete($assetId)
|
||||
{
|
||||
Asset::destroy($assetId);
|
||||
}
|
||||
|
||||
public function create(array $assetDetails)
|
||||
{
|
||||
return Asset::create($assetDetails);
|
||||
}
|
||||
|
||||
public function update($assetId, array $newDetails)
|
||||
{
|
||||
return Asset::where('asset_id', $assetId)->update($newDetails);
|
||||
}
|
||||
|
||||
public function pluckAvailable()
|
||||
{
|
||||
return Asset::where('is_available', 1)->pluck('name', 'asset_id');
|
||||
}
|
||||
|
||||
}
|
30
Modules/Asset/composer.json
Normal file
30
Modules/Asset/composer.json
Normal file
@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "nwidart/asset",
|
||||
"description": "",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Widart",
|
||||
"email": "n.widart@gmail.com"
|
||||
}
|
||||
],
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [],
|
||||
"aliases": {
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Modules\\Asset\\": "app/",
|
||||
"Modules\\Asset\\Database\\Factories\\": "database/factories/",
|
||||
"Modules\\Asset\\Database\\Seeders\\": "database/seeders/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Modules\\Asset\\Tests\\": "tests/"
|
||||
}
|
||||
}
|
||||
}
|
0
Modules/Asset/config/.gitkeep
Normal file
0
Modules/Asset/config/.gitkeep
Normal file
5
Modules/Asset/config/config.php
Normal file
5
Modules/Asset/config/config.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'name' => 'Asset',
|
||||
];
|
0
Modules/Asset/database/factories/.gitkeep
Normal file
0
Modules/Asset/database/factories/.gitkeep
Normal file
0
Modules/Asset/database/migrations/.gitkeep
Normal file
0
Modules/Asset/database/migrations/.gitkeep
Normal file
@ -0,0 +1,47 @@
|
||||
<?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_assets', function (Blueprint $table) {
|
||||
$table->unsignedTinyInteger('asset_id')->autoIncrement();
|
||||
$table->string('name')->nullable();
|
||||
$table->date('purchased_date')->nullable();
|
||||
$table->string('purchased_from')->nullable();
|
||||
$table->string('manufacturer')->nullable();
|
||||
$table->string('model')->nullable();
|
||||
$table->string('serial_number')->nullable();
|
||||
$table->string('supplier')->nullable();
|
||||
$table->string('condition')->nullable();
|
||||
$table->string('warranty')->nullable();
|
||||
$table->string('value')->nullable();
|
||||
$table->unsignedBigInteger('asset_category_id')->nullable();
|
||||
$table->unsignedBigInteger('asset_user')->nullable();
|
||||
$table->integer('status')->default(11);
|
||||
$table->longText('description')->nullable();
|
||||
$table->longText('remarks')->nullable();
|
||||
$table->date('approved_date')->nullable();
|
||||
$table->boolean('is_available')->default(1);
|
||||
$table->unsignedBigInteger('approved_by')->nullable();
|
||||
$table->unsignedBigInteger('createdBy')->nullable();
|
||||
$table->unsignedBigInteger('updatedBy')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('tbl_assets');
|
||||
}
|
||||
};
|
@ -0,0 +1,30 @@
|
||||
<?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_asset_categories', function (Blueprint $table) {
|
||||
$table->unsignedTinyInteger('asset_category_id')->autoIncrement();
|
||||
$table->string('name')->default(11);
|
||||
$table->integer('status')->default(11);
|
||||
$table->mediumText('description')->nullable();
|
||||
$table->mediumText('remarks')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('tbl_asset_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_asset_demands', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('department_id')->nullable();
|
||||
$table->unsignedBigInteger('designation_id')->nullable();
|
||||
$table->unsignedBigInteger('employee_id')->nullable();
|
||||
$table->unsignedBigInteger('asset_id')->nullable();
|
||||
$table->date('request_date')->nullable();
|
||||
$table->integer('status')->default(11);
|
||||
$table->mediumText('reason')->nullable();
|
||||
$table->mediumText('description')->nullable();
|
||||
$table->mediumText('remarks')->nullable();
|
||||
$table->unsignedBigInteger('createdby')->nullable();
|
||||
$table->unsignedBigInteger('updatedBy')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('tbl_asset_demands');
|
||||
}
|
||||
};
|
0
Modules/Asset/database/seeders/.gitkeep
Normal file
0
Modules/Asset/database/seeders/.gitkeep
Normal file
16
Modules/Asset/database/seeders/AssetDatabaseSeeder.php
Normal file
16
Modules/Asset/database/seeders/AssetDatabaseSeeder.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Asset\database\seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class AssetDatabaseSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// $this->call([]);
|
||||
}
|
||||
}
|
11
Modules/Asset/module.json
Normal file
11
Modules/Asset/module.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "Asset",
|
||||
"alias": "asset",
|
||||
"description": "",
|
||||
"keywords": [],
|
||||
"priority": 0,
|
||||
"providers": [
|
||||
"Modules\\Asset\\Providers\\AssetServiceProvider"
|
||||
],
|
||||
"files": []
|
||||
}
|
15
Modules/Asset/package.json
Normal file
15
Modules/Asset/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/Asset/resources/assets/.gitkeep
Normal file
0
Modules/Asset/resources/assets/.gitkeep
Normal file
0
Modules/Asset/resources/assets/js/app.js
Normal file
0
Modules/Asset/resources/assets/js/app.js
Normal file
0
Modules/Asset/resources/assets/sass/app.scss
Normal file
0
Modules/Asset/resources/assets/sass/app.scss
Normal file
0
Modules/Asset/resources/views/.gitkeep
Normal file
0
Modules/Asset/resources/views/.gitkeep
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 -->
|
||||
|
||||
<div class='card'>
|
||||
<div class='card-body'>
|
||||
|
||||
{{ html()->form('POST')->route('assetCategory.store')->class(['needs-validation'])->attributes(['novalidate'])->open() }}
|
||||
|
||||
@include('asset::assetcategories.partials.action')
|
||||
|
||||
{{ html()->form()->close() }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
23
Modules/Asset/resources/views/assetcategories/edit.blade.php
Normal file
23
Modules/Asset/resources/views/assetcategories/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 -->
|
||||
|
||||
<div class='card'>
|
||||
<div class='card-body'>
|
||||
|
||||
{{ html()->modelForm($assetCategory, 'PUT')->route('assetCategory.update', $assetCategory->asset_category_id)->class(['needs-validation'])->attributes(['novalidate'])->open() }}
|
||||
|
||||
@include('asset::assetcategories.partials.action')
|
||||
|
||||
{{ html()->form()->close() }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
@ -0,0 +1,71 @@
|
||||
@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 -->
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">{{ $title }}</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('assetCategory.create') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Create AssetCategory</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table id="buttons-datatables" class="display table-sm table-bordered table">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="tb-col"><span class="overline-title">S.N</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Name</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Status</span></th>
|
||||
<th class="tb-col" data-sortable="false"><span class="overline-title">Action</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@foreach ($assetCategoryLists as $index => $item)
|
||||
<tr>
|
||||
<td class="tb-col">{{ $index + 1 }}</td>
|
||||
<td class="tb-col">{{ $item->name }}</td>
|
||||
<td class="tb-col">{{ $item->status }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown"
|
||||
aria-expanded="false">
|
||||
<i class="ri-more-fill align-middle"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a href="{{ route('assetCategory.show', [$item->asset_category_id]) }}" class="dropdown-item"><i
|
||||
class="ri-eye-fill text-muted me-2 align-bottom"></i> View</a>
|
||||
</li>
|
||||
|
||||
<li><a href="{{ route('assetCategory.edit', [$item->asset_category_id]) }}"
|
||||
class="dropdown-item edit-item-btn"><i
|
||||
class="ri-pencil-fill text-muted me-2 align-bottom"></i>
|
||||
Edit</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="{{ route('appreciation.destroy', [$item->asset_category_id]) }}"
|
||||
class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill text-muted me-2 align-bottom"></i> Delete
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
@ -0,0 +1,39 @@
|
||||
<div class="row gy-3">
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Asset Category')->class('form-label') }}
|
||||
{{ html()->select('asset_category_id',$assetCategoryLists)->class('form-select select2')->placeholder('Asset Category Name')->required() }}
|
||||
{{ html()->div('Please Select Asset Category Name')->class('invalid-feedback') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Asset User (If provided to)')->class('form-label') }}
|
||||
{{ html()->select('asset_user', $employeeList)->class('form-select select2')->placeholder('Asset User')->required() }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Approved By (If asset user)')->class('form-label') }}
|
||||
{{ html()->select('approved_by', $employeeList)->class('form-select select2')->placeholder('Approved By') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6 col-md-6">
|
||||
{{ html()->label('Department')->class('form-label') }}
|
||||
{{ html()->select('department_id', $departmentList)->class('form-select select2')->placeholder('Department')->required() }}
|
||||
{{ html()->div('Please Select Department')->class('invalid-feedback') }}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 col-md-12">
|
||||
{{ html()->label('Name')->class('form-label') }}
|
||||
{{ html()->text('name')->class('form-control')->placeholder('Category Name') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 col-md-12">
|
||||
{{ html()->label('Description')->class('form-label') }}
|
||||
{{ html()->textarea('description')->class('form-control')->attributes(['rows' => 3]) }}
|
||||
</div>
|
||||
|
||||
<div class="text-end">
|
||||
{{ html()->button($editable ? 'Update' : 'Add Asset Category', 'submit')->class('btn btn-success') }}
|
||||
</div>
|
||||
</div>
|
48
Modules/Asset/resources/views/assetcategories/show.blade.php
Normal file
48
Modules/Asset/resources/views/assetcategories/show.blade.php
Normal file
@ -0,0 +1,48 @@
|
||||
@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 -->
|
||||
|
||||
<div class='card'>
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">View Detail</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('designations.index') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Back to List</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='card-body'>
|
||||
<p><b>Title : </b> <span>{{ $data->title }}</span></p>
|
||||
<p><b>Alias : </b> <span>{{ $data->alias }}</span></p>
|
||||
<p><b>Status : </b> <span
|
||||
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
|
||||
</p>
|
||||
<p><b>Remarks : </b> <span>{{ $data->remarks }}</span></p>
|
||||
<p><b>Display Order : </b> <span>{{ $data->display_order }}</span></p>
|
||||
<p><b>Createdby : </b> <span>{{ $data->createdby }}</span></p>
|
||||
<p><b>Updatedby : </b> <span>{{ $data->updatedby }}</span></p>
|
||||
<p><b>Job Description : </b> <span>{{ $data->job_description }}</span></p>
|
||||
<p><b>Departments Id : </b> <span>{{ $data->departments_id }}</span></p>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{ $data->created_at }}</span></p>
|
||||
<p><b>Created By :</b> <span>{{ $data->createdBy }}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{ $data->updated_at }}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{ $data->updatedBy }}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endSection
|
23
Modules/Asset/resources/views/assetdemands/create.blade.php
Normal file
23
Modules/Asset/resources/views/assetdemands/create.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 -->
|
||||
|
||||
<div class='card'>
|
||||
<div class='card-body'>
|
||||
|
||||
{{ html()->form('POST')->route('assetDemand.store')->class(['needs-validation'])->attributes(['novalidate'])->open() }}
|
||||
|
||||
@include('asset::assetdemands.partials.action')
|
||||
|
||||
{{ html()->form()->close() }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
23
Modules/Asset/resources/views/assetdemands/edit.blade.php
Normal file
23
Modules/Asset/resources/views/assetdemands/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 -->
|
||||
|
||||
<div class='card'>
|
||||
<div class='card-body'>
|
||||
|
||||
{{ html()->modelForm($assetDemand, 'PUT')->route('assetDemand.update', $assetDemand->asset_category_id)->class(['needs-validation'])->attributes(['novalidate'])->open() }}
|
||||
|
||||
@include('asset::assetdemands.partials.action')
|
||||
|
||||
{{ html()->form()->close() }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
70
Modules/Asset/resources/views/assetdemands/index.blade.php
Normal file
70
Modules/Asset/resources/views/assetdemands/index.blade.php
Normal file
@ -0,0 +1,70 @@
|
||||
@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 -->
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">{{ $title }}</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('assetDemand.create') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Create AssetDemand</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table id="buttons-datatables" class="display table-sm table-bordered table">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="tb-col"><span class="overline-title">S.N</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Name</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Status</span></th>
|
||||
<th class="tb-col" data-sortable="false"><span class="overline-title">Action</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@foreach ($assetDemandLists as $index => $item)
|
||||
<tr>
|
||||
<td class="tb-col">{{ $index + 1 }}</td>
|
||||
<td class="tb-col">{{ $item->name }}</td>
|
||||
<td class="tb-col">{{ $item->status }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown"
|
||||
aria-expanded="false">
|
||||
<i class="ri-more-fill align-middle"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a href="{{ route('assetDemand.show', [$item->id]) }}" class="dropdown-item"><i
|
||||
class="ri-eye-fill text-muted me-2 align-bottom"></i> View</a>
|
||||
</li>
|
||||
|
||||
<li><a href="{{ route('assetDemand.edit', [$item->id]) }}" class="dropdown-item edit-item-btn"><i
|
||||
class="ri-pencil-fill text-muted me-2 align-bottom"></i>
|
||||
Edit</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="{{ route('appreciation.destroy', [$item->id]) }}" class="dropdown-item remove-item-btn"
|
||||
onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill text-muted me-2 align-bottom"></i> Delete
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
@ -0,0 +1,41 @@
|
||||
<div class="row gy-3">
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Name')->class('form-label') }}
|
||||
{{ html()->text('name')->class('form-control')->placeholder('Category Name') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Department')->class('form-label') }}
|
||||
{{ html()->select('department_id')->class('form-select select2')->placeholder('Department') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Designation')->class('form-label') }}
|
||||
{{ html()->select('designation_id')->class('form-select select2')->placeholder('Desgination') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Employee')->class('form-label') }}
|
||||
{{ html()->select('employee_id')->class('form-select select2')->placeholder('Employee') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Asset')->class('form-label') }}
|
||||
{{ html()->select('asset_id', $availableAssetLists)->class('form-select select2')->placeholder('Available Asset') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Date')->class('form-label') }}
|
||||
{{ html()->date('request_date')->class('form-control') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 col-md-12">
|
||||
{{ html()->label('Reason')->class('form-label') }}
|
||||
{{ html()->textarea('reason')->class('form-control')->attributes(['rows' => 3]) }}
|
||||
</div>
|
||||
|
||||
<div class="text-end">
|
||||
{{ html()->button($editable ? 'Update' : 'Add Demand', 'submit')->class('btn btn-success') }}
|
||||
</div>
|
||||
</div>
|
48
Modules/Asset/resources/views/assetdemands/show.blade.php
Normal file
48
Modules/Asset/resources/views/assetdemands/show.blade.php
Normal file
@ -0,0 +1,48 @@
|
||||
@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 -->
|
||||
|
||||
<div class='card'>
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">View Detail</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('designations.index') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Back to List</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='card-body'>
|
||||
<p><b>Title : </b> <span>{{ $data->title }}</span></p>
|
||||
<p><b>Alias : </b> <span>{{ $data->alias }}</span></p>
|
||||
<p><b>Status : </b> <span
|
||||
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
|
||||
</p>
|
||||
<p><b>Remarks : </b> <span>{{ $data->remarks }}</span></p>
|
||||
<p><b>Display Order : </b> <span>{{ $data->display_order }}</span></p>
|
||||
<p><b>Createdby : </b> <span>{{ $data->createdby }}</span></p>
|
||||
<p><b>Updatedby : </b> <span>{{ $data->updatedby }}</span></p>
|
||||
<p><b>Job Description : </b> <span>{{ $data->job_description }}</span></p>
|
||||
<p><b>Departments Id : </b> <span>{{ $data->departments_id }}</span></p>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{ $data->created_at }}</span></p>
|
||||
<p><b>Created By :</b> <span>{{ $data->createdBy }}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{ $data->updated_at }}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{ $data->updatedBy }}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endSection
|
23
Modules/Asset/resources/views/assets/create.blade.php
Normal file
23
Modules/Asset/resources/views/assets/create.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 -->
|
||||
|
||||
<div class='card'>
|
||||
<div class='card-body'>
|
||||
|
||||
{{ html()->form('POST')->route('asset.store')->class(['needs-validation'])->attributes(['novalidate'])->open() }}
|
||||
|
||||
@include('asset::assets.partials.action')
|
||||
|
||||
{{ html()->form()->close() }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
23
Modules/Asset/resources/views/assets/edit.blade.php
Normal file
23
Modules/Asset/resources/views/assets/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 -->
|
||||
|
||||
<div class='card'>
|
||||
<div class='card-body'>
|
||||
|
||||
{{ html()->modelForm($asset, 'PUT')->route('asset.update', $asset->asset_id)->class(['needs-validation'])->attributes(['novalidate'])->open() }}
|
||||
|
||||
@include('asset::assets.partials.action')
|
||||
|
||||
{{ html()->form()->close() }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
81
Modules/Asset/resources/views/assets/index.blade.php
Normal file
81
Modules/Asset/resources/views/assets/index.blade.php
Normal file
@ -0,0 +1,81 @@
|
||||
@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 -->
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">{{ $title }}</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('asset.create') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Create Asset</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table id="buttons-datatables" class="display table-sm table-bordered table">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="tb-col"><span class="overline-title">S.N</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Asset User</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Name</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Purchased Date</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Condition</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Value</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Availability</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Status</span></th>
|
||||
<th class="tb-col" data-sortable="false"><span class="overline-title">Action</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@foreach ($assetLists as $index => $item)
|
||||
<tr>
|
||||
<td class="tb-col">{{ $index + 1 }}</td>
|
||||
<td class="tb-col">{{ $item->asset_user }}</td>
|
||||
<td class="tb-col">{{ $item->name }}</td>
|
||||
<td class="tb-col">{{ $item->purchased_date }}</td>
|
||||
<td class="tb-col">{{ $item->condition }}</td>
|
||||
<td class="tb-col">{{ $item->value }}</td>
|
||||
<td class="tb-col">{{ $item->is_available? 'Available' : 'Distributed' }}</td>
|
||||
<td class="tb-col">{{ $item->status }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown"
|
||||
aria-expanded="false">
|
||||
<i class="ri-more-fill align-middle"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a href="{{ route('asset.show', [$item->asset_category_id]) }}" class="dropdown-item"><i
|
||||
class="ri-eye-fill text-muted me-2 align-bottom"></i> View</a>
|
||||
</li>
|
||||
|
||||
<li><a href="{{ route('asset.edit', [$item->asset_category_id]) }}"
|
||||
class="dropdown-item edit-item-btn"><i
|
||||
class="ri-pencil-fill text-muted me-2 align-bottom"></i>
|
||||
Edit</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="{{ route('appreciation.destroy', [$item->asset_category_id]) }}"
|
||||
class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill text-muted me-2 align-bottom"></i> Delete
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
@ -0,0 +1,86 @@
|
||||
<div class="row gy-3">
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Asset Category')->class('form-label') }}
|
||||
{{ html()->select('asset_category_id',$assetCategoryLists)->class('form-select select2')->placeholder('Asset Category Name') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Name')->class('form-label') }}
|
||||
{{ html()->text('name')->class('form-control')->placeholder('Asset Name') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Purchased Date')->class('form-label') }}
|
||||
{{ html()->date('purchased_date')->class('form-control') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Purchased From (If not from supplier)')->class('form-label') }}
|
||||
{{ html()->text('purchased_from')->class('form-control')->placeholder('Purchased From') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Manufacturer')->class('form-label') }}
|
||||
{{ html()->text('manufacturer')->class('form-control')->placeholder('Manufacturer Name') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Model')->class('form-label') }}
|
||||
{{ html()->text('model')->class('form-control')->placeholder('Model Number') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Supplier')->class('form-label') }}
|
||||
{{ html()->text('supplier')->class('form-control')->placeholder('Supplier Name') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Serial Number')->class('form-label') }}
|
||||
{{ html()->text('serial_number')->class('form-control')->placeholder('Serial Number') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Value')->class('form-label') }}
|
||||
{{ html()->text('value')->class('form-control')->placeholder('Asset Value') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Warranty')->class('form-label') }}
|
||||
{{ html()->text('condition')->class('form-control')->placeholder('Warranty Period') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Condition')->class('form-label') }}
|
||||
{{ html()->text('condition')->class('form-control')->placeholder('Condition') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Asset User (If provided to)')->class('form-label') }}
|
||||
{{ html()->select('asset_user',$employeeList)->class('form-select select2')->placeholder('Asset User') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Approved By (If asset user)')->class('form-label') }}
|
||||
{{ html()->select('approved_by',$employeeList)->class('form-select select2')->placeholder('Approved By') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Approved Date (If asset user)')->class('form-label') }}
|
||||
{{ html()->date('approved_date')->class('form-control') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 col-md-12">
|
||||
{{ html()->label('Description')->class('form-label') }}
|
||||
{{ html()->textarea('description')->class('form-control')->attributes(['rows' => 3]) }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 col-md-12">
|
||||
{{ html()->label('Remarks')->class('form-label') }}
|
||||
{{ html()->textarea('remarks')->class('form-control')->attributes(['rows' => 3]) }}
|
||||
</div>
|
||||
|
||||
<div class="text-end">
|
||||
{{ html()->button($editable ? 'Update' : 'Add Asset', 'submit')->class('btn btn-success') }}
|
||||
</div>
|
||||
</div>
|
48
Modules/Asset/resources/views/assets/show.blade.php
Normal file
48
Modules/Asset/resources/views/assets/show.blade.php
Normal file
@ -0,0 +1,48 @@
|
||||
@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 -->
|
||||
|
||||
<div class='card'>
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">View Detail</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('designations.index') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Back to List</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='card-body'>
|
||||
<p><b>Title : </b> <span>{{ $data->title }}</span></p>
|
||||
<p><b>Alias : </b> <span>{{ $data->alias }}</span></p>
|
||||
<p><b>Status : </b> <span
|
||||
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
|
||||
</p>
|
||||
<p><b>Remarks : </b> <span>{{ $data->remarks }}</span></p>
|
||||
<p><b>Display Order : </b> <span>{{ $data->display_order }}</span></p>
|
||||
<p><b>Createdby : </b> <span>{{ $data->createdby }}</span></p>
|
||||
<p><b>Updatedby : </b> <span>{{ $data->updatedby }}</span></p>
|
||||
<p><b>Job Description : </b> <span>{{ $data->job_description }}</span></p>
|
||||
<p><b>Departments Id : </b> <span>{{ $data->departments_id }}</span></p>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{ $data->created_at }}</span></p>
|
||||
<p><b>Created By :</b> <span>{{ $data->createdBy }}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{ $data->updated_at }}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{ $data->updatedBy }}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endSection
|
7
Modules/Asset/resources/views/index.blade.php
Normal file
7
Modules/Asset/resources/views/index.blade.php
Normal file
@ -0,0 +1,7 @@
|
||||
@extends('asset::layouts.master')
|
||||
|
||||
@section('content')
|
||||
<h1>Hello World</h1>
|
||||
|
||||
<p>Module: {!! config('asset.name') !!}</p>
|
||||
@endsection
|
29
Modules/Asset/resources/views/layouts/master.blade.php
Normal file
29
Modules/Asset/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>Asset 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-asset', 'resources/assets/sass/app.scss') }} --}}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@yield('content')
|
||||
|
||||
{{-- Vite JS --}}
|
||||
{{-- {{ module_vite('build-asset', 'resources/assets/js/app.js') }} --}}
|
||||
</body>
|
0
Modules/Asset/routes/.gitkeep
Normal file
0
Modules/Asset/routes/.gitkeep
Normal file
19
Modules/Asset/routes/api.php
Normal file
19
Modules/Asset/routes/api.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Modules\Asset\Http\Controllers\AssetController;
|
||||
|
||||
/*
|
||||
*--------------------------------------------------------------------------
|
||||
* 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('asset', AssetController::class)->names('asset');
|
||||
});
|
23
Modules/Asset/routes/web.php
Normal file
23
Modules/Asset/routes/web.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Modules\Asset\Http\Controllers\AssetCategoryController;
|
||||
use Modules\Asset\Http\Controllers\AssetController;
|
||||
use Modules\Asset\Http\Controllers\AssetDemandController;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| 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('asset', AssetController::class)->names('asset');
|
||||
Route::resource('asset-category', AssetCategoryController::class)->names('assetCategory');
|
||||
Route::resource('asset-demand', AssetDemandController::class)->names('assetDemand');
|
||||
});
|
26
Modules/Asset/vite.config.js
Normal file
26
Modules/Asset/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-asset',
|
||||
emptyOutDir: true,
|
||||
manifest: true,
|
||||
},
|
||||
plugins: [
|
||||
laravel({
|
||||
publicDirectory: '../../public',
|
||||
buildDirectory: 'build-asset',
|
||||
input: [
|
||||
__dirname + '/resources/assets/sass/app.scss',
|
||||
__dirname + '/resources/assets/js/app.js'
|
||||
],
|
||||
refresh: true,
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
//export const paths = [
|
||||
// 'Modules/Asset/resources/assets/sass/app.scss',
|
||||
// 'Modules/Asset/resources/assets/js/app.js',
|
||||
//];
|
Reference in New Issue
Block a user