first commit
This commit is contained in:
@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Modules\Admin\Repositories\ProgressStatusRepository;
|
||||
|
||||
class ProgressStatusController extends Controller
|
||||
{
|
||||
private $progressStatusRepository;
|
||||
|
||||
public function __construct(ProgressStatusRepository $progressStatusRepository)
|
||||
{
|
||||
$this->progressStatusRepository = $progressStatusRepository;
|
||||
}
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$data['title'] = 'ProgressStatus List';
|
||||
$data['progressStatusLists'] = $this->progressStatusRepository->findAll();
|
||||
return view('admin::progressstatuses.index', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$data['title'] = 'Create ProgressStatus';
|
||||
$data['editable'] = false;
|
||||
return view('admin::progressstatuses.create', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
$this->progressStatusRepository->create($request->all());
|
||||
return redirect()->route('progressStatus.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
return view('admin::progressstatuses.show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$data['title'] = 'Edit ProgressStatus';
|
||||
$data['editable'] = true;
|
||||
$data['progressStatus'] = $this->progressStatusRepository->getProgressStatusById($id);
|
||||
return view('admin::progressstatuses.edit', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id): RedirectResponse
|
||||
{
|
||||
$this->progressStatusRepository->update($id, $request->all());
|
||||
return redirect()->route('progressStatus.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user