first commit

This commit is contained in:
Sampanna Rimal
2024-08-27 17:48:06 +05:45
commit 53c0140f58
10839 changed files with 1125847 additions and 0 deletions

View File

@ -0,0 +1,107 @@
<?php
namespace Modules\Office\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Modules\Office\Repositories\ContractInterface;
use Modules\Office\Repositories\ContractRepository;
class ContractController extends Controller
{
private $contractRepository;
public function __construct(ContractInterface $contractRepository)
{
$this->contractRepository = $contractRepository;
}
/**
* Display a listing of the resource.
*/
public function index()
{
$data['title'] = "Contract Lists";
$data['contractLists'] = $this->contractRepository->findAll();
return view('office::contracts.index', $data);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
$data['title'] = "Create Contract";
$data['editable'] = false;
return view('office::contracts.create', $data);
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request): RedirectResponse
{
try {
$this->contractRepository->create($request->all());
toastr()->success('Contract Created Successfully.');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('contract.index');
}
/**
* Show the specified resource.
*/
public function show($id)
{
return view('office::contracts.show');
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
$data['title'] = "Edit Contract";
$data['editable'] = true;
$data['contract'] = $this->contractRepository->getContractById($id);
return view('office::contracts.edit', $data);
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id): RedirectResponse
{
try {
$this->contractRepository->update($id, $request->except(['_token', '_method']));
toastr()->success('Contract Updated Successfully.');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('contract.index');
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
try {
$this->contractRepository->delete($id);
toastr()->success('Contract deleted successfully.');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('contract.index');
}
}

View File

@ -0,0 +1,107 @@
<?php
namespace Modules\Office\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Modules\Office\Repositories\DepositInterface;
use Modules\Office\Repositories\DepositRepository;
class DepositController extends Controller
{
private $depositRepository;
public function __construct(DepositInterface $depositRepository)
{
$this->depositRepository = $depositRepository;
}
/**
* Display a listing of the resource.
*/
public function index()
{
$data['title'] = "Deposit Lists";
$data['depositLists'] = $this->depositRepository->findAll();
return view('office::deposits.index', $data);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
$data['title'] = "Create Deposit";
$data['editable'] = false;
return view('office::deposits.create', $data);
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request): RedirectResponse
{
try {
$this->depositRepository->create($request->all());
toastr()->success('Deposit Created Successfully.');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('deposit.index');
}
/**
* Show the specified resource.
*/
public function show($id)
{
return view('office::deposits.show');
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
$data['title'] = "Edit Deposit";
$data['editable'] = true;
$data['deposit'] = $this->depositRepository->getDepositById($id);
return view('office::deposits.edit', $data);
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id): RedirectResponse
{
try {
$this->depositRepository->update($id, $request->except(['_token', '_method']));
toastr()->success('Deposit Updated Successfully.');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
// return redirect()->route('deposit.index');
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
try {
$this->depositRepository->delete($id);
toastr()->success('Deposit deleted successfully.');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('deposit.index');
}
}

View File

@ -0,0 +1,107 @@
<?php
namespace Modules\Office\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Modules\Office\Repositories\GeneratorInterface;
use Modules\Office\Repositories\GeneratorRepository;
class GeneratorController extends Controller
{
private $generatorRepository;
public function __construct(GeneratorInterface $generatorRepository)
{
$this->generatorRepository = $generatorRepository;
}
/**
* Display a listing of the resource.
*/
public function index()
{
$data['title'] = "Generator Lists";
$data['generatorLists'] = $this->generatorRepository->findAll();
return view('office::generators.index', $data);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
$data['title'] = "Create Generator";
$data['editable'] = false;
return view('office::generators.create', $data);
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request): RedirectResponse
{
try {
$this->generatorRepository->create($request->all());
toastr()->success('Generator Created Successfully.');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('generator.index');
}
/**
* Show the specified resource.
*/
public function show($id)
{
return view('office::generators.show');
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
$data['title'] = "Edit Generator";
$data['editable'] = true;
$data['generator'] = $this->generatorRepository->getGeneratorById($id);
return view('office::generators.edit', $data);
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id): RedirectResponse
{
try {
$this->generatorRepository->update($id, $request->all());
toastr()->success('Generator Updated Successfully.');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('generator.index');
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
try {
$this->generatorRepository->delete($id);
toastr()->success('Generator deleted successfully.');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('generator.index');
}
}

View File

@ -0,0 +1,112 @@
<?php
namespace Modules\Office\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Modules\Office\Repositories\GeneratorLogBookInterface;
use Modules\Office\Repositories\GeneratorLogBookRepository;
use Modules\Office\Repositories\GeneratorRepository;
class GeneratorLogBookController extends Controller
{
private $generatorLogBookRepository;
private $generatorRepository;
public function __construct(GeneratorLogBookInterface $generatorLogBookRepository,GeneratorLogBookInterface $generatorRepository)
{
$this->generatorLogBookRepository = $generatorLogBookRepository;
$this->generatorRepository = $generatorRepository;
}
/**
* Display a listing of the resource.
*/
public function index()
{
$data['title'] = "GeneratorLogBook Lists";
$data['generatorLogBookLists'] = $this->generatorLogBookRepository->findAll();
return view('office::generatorlogbooks.index', $data);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
$data['title'] = "Create GeneratorLogBook";
$data['editable'] = false;
$data['generatorLists'] = $this->generatorRepository->pluck();
return view('office::generatorlogbooks.create', $data);
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request): RedirectResponse
{
try {
$this->generatorLogBookRepository->create($request->all());
toastr()->success('GeneratorLogBook Created Successfully.');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('generatorLogBook.index');
}
/**
* Show the specified resource.
*/
public function show($id)
{
return view('office::generatorlogbooks.show');
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
$data['title'] = "Edit GeneratorLogBook";
$data['editable'] = true;
$data['generatorLogBook'] = $this->generatorLogBookRepository->getGeneratorLogBookById($id);
$data['generatorLists'] = $this->generatorRepository->pluck();
return view('office::generatorlogbooks.edit', $data);
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id): RedirectResponse
{
try {
$this->generatorLogBookRepository->update($id, $request->all());
toastr()->success('GeneratorLogBook Updated Successfully.');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('generatorLogBook.index');
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
try {
$this->generatorLogBookRepository->delete($id);
toastr()->success('GeneratorLogBook deleted successfully.');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('generatorLogBook.index');
}
}

View File

@ -0,0 +1,67 @@
<?php
namespace Modules\Office\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
class OfficeController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
return view('office::index');
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
return view('office::create');
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request): RedirectResponse
{
//
}
/**
* Show the specified resource.
*/
public function show($id)
{
return view('office::show');
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
return view('office::edit');
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id): RedirectResponse
{
//
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
//
}
}

View File

@ -0,0 +1,107 @@
<?php
namespace Modules\Office\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Modules\Office\Repositories\PurchaseServiceInterface;
use Modules\Office\Repositories\PurchaseServiceRepository;
class PurchaseServiceController extends Controller
{
private $purchaseServiceRepository;
public function __construct(PurchaseServiceInterface $purchaseServiceRepository)
{
$this->purchaseServiceRepository = $purchaseServiceRepository;
}
/**
* Display a listing of the resource.
*/
public function index()
{
$data['title'] = "PurchaseService Lists";
$data['purchaseServiceLists'] = $this->purchaseServiceRepository->findAll();
return view('office::purchaseservices.index', $data);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
$data['title'] = "Create PurchaseService";
$data['editable'] = false;
return view('office::purchaseservices.create', $data);
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request): RedirectResponse
{
try {
$this->purchaseServiceRepository->create($request->all());
toastr()->success('PurchaseService Created Successfully.');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('purchaseService.index');
}
/**
* Show the specified resource.
*/
public function show($id)
{
return view('office::purchaseservices.show');
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
$data['title'] = "Edit PurchaseService";
$data['editable'] = true;
$data['purchaseService'] = $this->purchaseServiceRepository->getPurchaseServiceById($id);
return view('office::purchaseservices.edit', $data);
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id): RedirectResponse
{
try {
$this->purchaseServiceRepository->update($id, $request->except(['_token', '_method']));
toastr()->success('PurchaseService Updated Successfully.');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
// return redirect()->route('purchaseService.index');
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
try {
$this->purchaseServiceRepository->delete($id);
toastr()->success('PurchaseService deleted successfully.');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('purchaseService.index');
}
}