Compare commits

...

2 Commits
master ... new

Author SHA1 Message Date
38ba8fac54 Merge remote-tracking branch 'origin/master' into new
# Conflicts:
#	composer.lock
2023-05-08 13:24:53 +07:00
eea0e3d304 update doc block 2023-05-05 07:54:31 +07:00
7 changed files with 829 additions and 659 deletions

View File

@ -6,6 +6,7 @@ use App\DataTables\DirectoratDataTable;
use App\Http\Requests\StoreDirectoratRequest;
use App\Http\Requests\UpdateDirectoratRequest;
use App\Models\Directorat;
use Exception;
use Illuminate\Http\Request;
use Spatie\Activitylog\Facades\CauserResolver;
@ -16,39 +17,39 @@ class DirectoratController extends Controller
public function __construct()
{
$this->middleware(function ($request, $next) {
//$this->user = Auth::guard('web')->user();
$this->user = Auth::guard('web')->user();
return $next($request);
});
//CauserResolver::setCauser($this->user);
}
/**
* Display a listing of the resource.
* Display a listing of the Directorats.
*
* @param \App\DataTables\DirectoratDataTable $dataTable
*
* @return mixed
*/
public function index(DirectoratDataTable $dataTable)
public function index(DirectoratDataTable $dataTable, Request $request)
{
/*if (is_null($this->user) || !$this->user->can('masters.read')) {
if (is_null($this->user) || !$this->user->can('masters.read')) {
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
}*/
}
return $dataTable->render('pages.masters.directorat.index');
}
/**
* Show the form for creating a new resource.
*/
public function create(){}
/**
* Store a newly created resource in storage.
* Store a newly created Directorat in storage.
*
* @param \App\Http\Requests\StoreDirectoratRequest $request
*
* @return mixed
*/
public function store(StoreDirectoratRequest $request)
{
/*if (is_null($this->user) || !$this->user->can('masters.create')) {
if (is_null($this->user) || !$this->user->can('masters.create')) {
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
}*/
}
// Validate the request...
$validated = $request->validated();
@ -57,41 +58,67 @@ class DirectoratController extends Controller
if ($validated) {
try {
Directorat::create($validated);
//return redirect()->route('directorat.index')->with('success', 'Directorat created successfully.');
echo json_encode(['status' => 'success', 'message' => 'Directorat created successfully.']);
}catch(\Exception $e){
//return redirect()->route('directorat.index')->with('error', 'Directorat created failed.');
} catch (Exception $e) {
echo json_encode(['status' => 'error', 'message' => 'Directorat created failed.']);
}
}
return false;
echo json_encode(['status' => 'error', 'message' => 'Directorat created failed.']);
}
/**
* Display the specified resource.
* Show the form for creating a new Directorat.
*/
public function create()
{
if (is_null($this->user) || !$this->user->can('masters.create')) {
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
}
show_404();
}
/**
* Display the specified Directorat.
*
* @param \App\Models\Directorat $directorat
*/
public function show(Directorat $directorat)
{
if (is_null($this->user) || !$this->user->can('masters.read')) {
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
}
}
/**
* Show the form for editing the specified resource.
* Show the form for editing the specified Directorat.
*
* @param $id
*/
public function edit($id){
public function edit($id)
{
if (is_null($this->user) || !$this->user->can('masters.update')) {
abort(403, 'Sorry !! You are Unauthorized to update any master data !');
}
$directorat = Directorat::find($id);
echo json_encode($directorat);
}
/**
* Update the specified resource in storage.
* Update the specified Directorat in storage.
*
* @param \App\Http\Requests\UpdateDirectoratRequest $request
* @param \App\Models\Directorat $directorat
*
* @return mixed
*/
public function update(UpdateDirectoratRequest $request, Directorat $directorat)
{
/*if (is_null($this->user) || !$this->user->can('masters.update')) {
if (is_null($this->user) || !$this->user->can('masters.update')) {
abort(403, 'Sorry !! You are Unauthorized to update any master data !');
}*/
}
// Validate the request...
$validated = $request->validated();
@ -102,21 +129,28 @@ class DirectoratController extends Controller
CauserResolver::setCauser($this->user);
$directorat->update($validated);
//return redirect()->route('directorat.index')->with('success', 'Directorat updated successfully.');
echo json_encode(['status' => 'success', 'message' => 'Directorat updated successfully.']);
}catch(\Exception $e){
//return redirect()->route('directorat.index')->with('error', 'Directorat updated failed.');
} catch (Exception $e) {
echo json_encode(['status' => 'error', 'message' => 'Directorat updated failed.']);
}
}
return false;
echo json_encode(['status' => 'error', 'message' => 'Directorat updated failed.']);
}
/**
* Remove the specified resource from storage.
* Remove the specified Directorat from storage.
*
* @param \App\Models\Directorat $directorat
*
* @return void
*/
public function destroy(Directorat $directorat){
public function destroy(Directorat $directorat)
{
if (is_null($this->user) || !$this->user->can('masters.delete')) {
abort(403, 'Sorry !! You are Unauthorized to delete any master data !');
}
$directorat->delete();
echo json_encode(['status' => 'success', 'message' => 'Directorat deleted successfully.']);
}

View File

@ -7,6 +7,7 @@ use App\Http\Requests\StoreJobRequest;
use App\Http\Requests\UpdateJobRequest;
use App\Models\Directorat;
use App\Models\Job;
use Exception;
use Illuminate\Http\Request;
class JobController extends Controller
@ -16,19 +17,25 @@ class JobController extends Controller
public function __construct()
{
$this->middleware(function ($request, $next) {
//$this->user = Auth::guard('web')->user();
$this->user = Auth::guard('web')->user();
return $next($request);
});
}
/**
* Display a listing of the resource.
* Display a listing of the Jobs.
*
* @param \App\DataTables\JobDataTable $dataTable
* @param \Illuminate\Http\Request $request
*
* @return mixed|void
*/
public function index(JobDataTable $dataTable, Request $request)
{
/*if (is_null($this->user) || !$this->user->can('masters.read')) {
if (is_null($this->user) || !$this->user->can('masters.read')) {
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
}*/
}
// Add Vendor
addVendor('chained-select');
@ -42,43 +49,18 @@ class JobController extends Controller
}
/**
* Show the form for creating a new resource.
*/
public function create(){}
/**
* Store a newly created resource in storage.
*/
public function store(StoreJobRequest $request)
{
/*if (is_null($this->user) || !$this->user->can('masters.create')) {
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
}*/
// Validate the request...
$validated = $request->validated();
// Store the Job...
if($validated){
try{
Job::create($validated);
//return redirect()->route('job.index')->with('success', 'Job created successfully.');
echo json_encode(['status' => 'success', 'message' => 'Job created successfully.']);
}catch(\Exception $e){
//return redirect()->route('job.index')->with('error', 'Job created failed.');
echo json_encode(['status' => 'error', 'message' => 'Job created failed.']);
}
}
return false;
}
/**
* Display the specified resource.
* Lists the specified Job by Sub Directorat ID.
*
* @param \Illuminate\Http\Request $request
*
* @return void
*/
public function show(Request $request)
{
if (is_null($this->user) || !$this->user->can('masters.read')) {
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
}
$jobs = Job::where('sub_directorat_id', $request->sub_directorat_id)->get();
$data = [];
@ -94,21 +76,76 @@ class JobController extends Controller
}
/**
* Show the form for editing the specified resource.
* Store a newly created Job in storage.
*
* @param \App\Http\Requests\StoreJobRequest $request
*
* @return void
*/
public function edit($id){
public function store(StoreJobRequest $request)
{
if (is_null($this->user) || !$this->user->can('masters.create')) {
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
}
// Validate the request...
$validated = $request->validated();
// Store the Job...
if ($validated) {
try {
Job::create($validated);
echo json_encode(['status' => 'success', 'message' => 'Job created successfully.']);
} catch (Exception $e) {
echo json_encode(['status' => 'error', 'message' => 'Job created failed.']);
}
}
echo json_encode(['status' => 'error', 'message' => 'Job created failed.']);
}
/**
* Show the form for creating a new Job.
*/
public function create()
{
if (is_null($this->user) || !$this->user->can('masters.create')) {
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
}
show_404();
}
/**
* Show the form for editing the specified Job.
*
* @param $id
*
* @return void
*/
public function edit($id)
{
if (is_null($this->user) || !$this->user->can('masters.update')) {
abort(403, 'Sorry !! You are Unauthorized to update any master data !');
}
$job = Job::find($id);
echo json_encode($job);
}
/**
* Update the specified resource in storage.
* Update the specified Job in storage.
*
* @param \App\Http\Requests\UpdateJobRequest $request
* @param \App\Models\Job $job
*
* @return void
*/
public function update(UpdateJobRequest $request, Job $job)
{
/*if (is_null($this->user) || !$this->user->can('masters.update')) {
if (is_null($this->user) || !$this->user->can('masters.update')) {
abort(403, 'Sorry !! You are Unauthorized to update any master data !');
}*/
}
// Validate the request...
$validated = $request->validated();
@ -117,23 +154,29 @@ class JobController extends Controller
if ($validated) {
try {
$job->update($validated);
//return redirect()->route('job.index')->with('success', 'Job updated successfully.');
echo json_encode(['status' => 'success', 'message' => 'Job updated successfully.']);
}catch(\Exception $e){
//return redirect()->route('job.index')->with('error', 'Job updated failed.');
} catch (Exception $e) {
echo json_encode(['status' => 'error', 'message' => 'Job updated failed.']);
}
}
return false;
echo json_encode(['status' => 'error', 'message' => 'Job updated failed.']);
}
/**
* Remove the specified resource from storage.
* Remove the specified Job from storage.
*
* @param \App\Models\Job $job
*
* @return void
*/
public function destroy(Job $job){
public function destroy(Job $job)
{
if (is_null($this->user) || !$this->user->can('masters.delete')) {
abort(403, 'Sorry !! You are Unauthorized to delete any master data !');
}
$job->delete();
echo json_encode(['status' => 'success', 'message' => 'Job deleted successfully.']);
//return redirect()->route('job.index')->with('success', 'Job deleted successfully.');
}
}

View File

@ -7,6 +7,7 @@ use App\Http\Requests\StoreSubDirectoratRequest;
use App\Http\Requests\UpdateSubDirectoratRequest;
use App\Models\Directorat;
use App\Models\SubDirectorat;
use Exception;
use Illuminate\Http\Request;
class SubDirectoratController extends Controller
@ -16,65 +17,40 @@ class SubDirectoratController extends Controller
public function __construct()
{
$this->middleware(function ($request, $next) {
//$this->user = Auth::guard('web')->user();
$this->user = Auth::guard('web')->user();
return $next($request);
});
}
/**
* Display a listing of the resource.
* Display a listing of the Sub Directorats.
*
* @param \App\DataTables\SubDirectoratDataTable $dataTable
* @param \Illuminate\Http\Request $request
*
* @return mixed|void
*/
public function index(SubDirectoratDataTable $dataTable, Request $request)
{
/*if (is_null($this->user) || !$this->user->can('masters.read')) {
if (is_null($this->user) || !$this->user->can('masters.read')) {
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
}*/
}
if (isset($request->directorat_id) && !empty($request->directorat_id)) {
$this->show($request);
return;
}
$directorat = Directorat::all();
return $dataTable->render('pages.masters.sub-directorat.index', compact('directorat'));
}
/**
* Show the form for creating a new resource.
*/
public function create(){}
/**
* Store a newly created resource in storage.
*/
public function store(StoreSubDirectoratRequest $request)
{
/*if (is_null($this->user) || !$this->user->can('masters.create')) {
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
}*/
// Validate the request...
$validated = $request->validated();
// Store the SubDirectorat...
if($validated){
try{
SubDirectorat::create($validated);
//return redirect()->route('directorat.index')->with('success', 'SubDirectorat created successfully.');
echo json_encode(['status' => 'success', 'message' => 'Sub Directorat created successfully.']);
}catch(\Exception $e){
//return redirect()->route('directorat.index')->with('error', 'SubDirectorat created failed.');
echo json_encode(['status' => 'error', 'message' => 'Sub Directorat created failed.']);
}
}
return false;
}
/**
* Display the specified resource.
* Lists the specified Sub Directorat by Directorat ID.
*
* @param \Illuminate\Http\Request $request
*
* @return void
*/
public function show(Request $request)
{
@ -93,21 +69,76 @@ class SubDirectoratController extends Controller
}
/**
* Show the form for editing the specified resource.
* Store a newly created Sub Directorat in storage.
*
* @param \App\Http\Requests\StoreSubDirectoratRequest $request
*
* @return void
*/
public function edit($id){
public function store(StoreSubDirectoratRequest $request)
{
if (is_null($this->user) || !$this->user->can('masters.create')) {
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
}
// Validate the request...
$validated = $request->validated();
// Store the SubDirectorat...
if ($validated) {
try {
SubDirectorat::create($validated);
echo json_encode(['status' => 'success', 'message' => 'Sub Directorat created successfully.']);
} catch (Exception $e) {
echo json_encode(['status' => 'error', 'message' => 'Sub Directorat created failed.']);
}
}
echo json_encode(['status' => 'error', 'message' => 'Sub Directorat created failed.']);
}
/**
* Show the form for creating a new Sub Directorat.
*/
public function create()
{
if (is_null($this->user) || !$this->user->can('masters.create')) {
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
}
show_404();
}
/**
* Show the form for editing the specified Sub Directorat.
*
* @param $id
*
* @return void
*/
public function edit($id)
{
if (is_null($this->user) || !$this->user->can('masters.update')) {
abort(403, 'Sorry !! You are Unauthorized to update any master data !');
}
$subDirectorat = SubDirectorat::find($id);
echo json_encode($subDirectorat);
}
/**
* Update the specified resource in storage.
* Update the specified Sub Directorat in storage.
*
* @param \App\Http\Requests\UpdateSubDirectoratRequest $request
* @param \App\Models\SubDirectorat $subDirectorat
*
* @return void
*/
public function update(UpdateSubDirectoratRequest $request, SubDirectorat $subDirectorat)
{
/*if (is_null($this->user) || !$this->user->can('masters.update')) {
if (is_null($this->user) || !$this->user->can('masters.update')) {
abort(403, 'Sorry !! You are Unauthorized to update any master data !');
}*/
}
// Validate the request...
$validated = $request->validated();
@ -116,23 +147,29 @@ class SubDirectoratController extends Controller
if ($validated) {
try {
$subDirectorat->update($validated);
//return redirect()->route('directorat.index')->with('success', 'SubDirectorat updated successfully.');
echo json_encode(['status' => 'success', 'message' => 'Sub Directorat updated successfully.']);
}catch(\Exception $e){
//return redirect()->route('directorat.index')->with('error', 'SubDirectorat updated failed.');
} catch (Exception $e) {
echo json_encode(['status' => 'error', 'message' => 'Sub Directorat updated failed.']);
}
}
return false;
echo json_encode(['status' => 'error', 'message' => 'Sub Directorat updated failed.']);
}
/**
* Remove the specified resource from storage.
* Remove the specified Sub Directorat from storage.
*
* @param \App\Models\SubDirectorat $subDirectorat
*
* @return void
*/
public function destroy(SubDirectorat $subDirectorat){
public function destroy(SubDirectorat $subDirectorat)
{
if (is_null($this->user) || !$this->user->can('masters.delete')) {
abort(403, 'Sorry !! You are Unauthorized to delete any master data !');
}
$subDirectorat->delete();
echo json_encode(['status' => 'success', 'message' => 'Sub Directorat deleted successfully.']);
//return redirect()->route('sub-directorat.index')->with('success', 'Sub Directorat deleted successfully.');
}
}

View File

@ -6,8 +6,8 @@ use App\DataTables\SubJobDataTable;
use App\Http\Requests\StoreSubJobRequest;
use App\Http\Requests\UpdateSubJobRequest;
use App\Models\Directorat;
use App\Models\Job;
use App\Models\SubJob;
use Exception;
use Illuminate\Http\Request;
class SubJobController extends Controller
@ -17,19 +17,25 @@ class SubJobController extends Controller
public function __construct()
{
$this->middleware(function ($request, $next) {
//$this->user = Auth::guard('web')->user();
$this->user = Auth::guard('web')->user();
return $next($request);
});
}
/**
* Display a listing of the resource.
* Display a listing of the Sub Jobs.
*
* @param \App\DataTables\SubJobDataTable $dataTable
* @param \Illuminate\Http\Request $request
*
* @return mixed|void
*/
public function index(SubJobDataTable $dataTable, Request $request)
{
/*if (is_null($this->user) || !$this->user->can('masters.read')) {
if (is_null($this->user) || !$this->user->can('masters.read')) {
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
}*/
}
addVendor('chained-select');
if (isset($request->job_id) && !empty($request->job_id)) {
@ -42,40 +48,11 @@ class SubJobController extends Controller
}
/**
* Show the form for creating a new resource.
*/
public function create(){}
/**
* Store a newly created resource in storage.
*/
public function store(StoreSubJobRequest $request)
{
/*if (is_null($this->user) || !$this->user->can('masters.create')) {
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
}*/
// Validate the request...
$validated = $request->validated();
// Store the SubJob...
if($validated){
try{
SubJob::create($validated);
//return redirect()->route('job.index')->with('success', 'SubJob created successfully.');
echo json_encode(['status' => 'success', 'message' => 'Sub Job created successfully.']);
}catch(\Exception $e){
//return redirect()->route('job.index')->with('error', 'SubJob created failed.');
echo json_encode(['status' => 'error', 'message' => 'Sub Job created failed.']);
}
}
return false;
}
/**
* Display the specified resource.
* Lists the specified Sub Job by Job ID.
*
* @param \Illuminate\Http\Request $request
*
* @return void
*/
public function show(Request $request)
{
@ -94,21 +71,78 @@ class SubJobController extends Controller
}
/**
* Show the form for editing the specified resource.
* Store a newly created Sub Job in storage.
*
* @param \App\Http\Requests\StoreSubJobRequest $request
*
* @return void
*/
public function edit($id){
public function store(StoreSubJobRequest $request)
{
if (is_null($this->user) || !$this->user->can('masters.create')) {
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
}
// Validate the request...
$validated = $request->validated();
// Store the SubJob...
if ($validated) {
try {
SubJob::create($validated);
echo json_encode(['status' => 'success', 'message' => 'Sub Job created successfully.']);
} catch (Exception $e) {
echo json_encode(['status' => 'error', 'message' => 'Sub Job created failed.']);
}
}
echo json_encode(['status' => 'error', 'message' => 'Sub Job created failed.']);
}
/**
* Show the form for creating a new Sub Job.
*
* @return void
*/
public function create()
{
if (is_null($this->user) || !$this->user->can('masters.create')) {
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
}
show_404();
}
/**
* Show the form for editing the specified Sub Job.
*
* @param $id
*
* @return void
*/
public function edit($id)
{
if (is_null($this->user) || !$this->user->can('masters.update')) {
abort(403, 'Sorry !! You are Unauthorized to update any master data !');
}
$subJob = SubJob::find($id);
echo json_encode($subJob);
}
/**
* Update the specified resource in storage.
* Update the specified Sub Job in storage.
*
* @param \App\Http\Requests\UpdateSubJobRequest $request
* @param \App\Models\SubJob $subJob
*
* @return false
*/
public function update(UpdateSubJobRequest $request, SubJob $subJob)
{
/*if (is_null($this->user) || !$this->user->can('masters.update')) {
if (is_null($this->user) || !$this->user->can('masters.update')) {
abort(403, 'Sorry !! You are Unauthorized to update any master data !');
}*/
}
// Validate the request...
$validated = $request->validated();
@ -117,23 +151,29 @@ class SubJobController extends Controller
if ($validated) {
try {
$subJob->update($validated);
//return redirect()->route('job.index')->with('success', 'SubJob updated successfully.');
echo json_encode(['status' => 'success', 'message' => 'Sub Job updated successfully.']);
}catch(\Exception $e){
//return redirect()->route('job.index')->with('error', 'SubJob updated failed.');
} catch (Exception $e) {
echo json_encode(['status' => 'error', 'message' => 'Sub Job updated failed.']);
}
}
return false;
echo json_encode(['status' => 'error', 'message' => 'Sub Job updated failed.']);
}
/**
* Remove the specified resource from storage.
* Remove the specified Sub Job from storage.
*
* @param \App\Models\SubJob $subJob
*
* @return void
*/
public function destroy(SubJob $subJob){
public function destroy(SubJob $subJob)
{
if (is_null($this->user) || !$this->user->can('masters.delete')) {
abort(403, 'Sorry !! You are Unauthorized to delete any master data !');
}
$subJob->delete();
echo json_encode(['status' => 'success', 'message' => 'Sub Job deleted successfully.']);
//return redirect()->route('sub-job.index')->with('success', 'Sub Job deleted successfully.');
}
}

View File

@ -6,8 +6,8 @@ use App\DataTables\SubSubJobDataTable;
use App\Http\Requests\StoreSubSubJobRequest;
use App\Http\Requests\UpdateSubSubJobRequest;
use App\Models\Directorat;
use App\Models\Job;
use App\Models\SubSubJob;
use Exception;
use Illuminate\Http\Request;
class SubSubJobController extends Controller
@ -17,19 +17,24 @@ class SubSubJobController extends Controller
public function __construct()
{
$this->middleware(function ($request, $next) {
//$this->user = Auth::guard('web')->user();
$this->user = Auth::guard('web')->user();
return $next($request);
});
}
/**
* Display a listing of the resource.
* Display a listing of the Sub Sub Jobs.
*
* @param \App\DataTables\SubSubJobDataTable $dataTable
* @param \Illuminate\Http\Request $request
*
* @return mixed|void
*/
public function index(SubSubJobDataTable $dataTable, Request $request)
{
/*if (is_null($this->user) || !$this->user->can('masters.read')) {
if (is_null($this->user) || !$this->user->can('masters.read')) {
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
}*/
}
if (isset($request->sub_job_id) && !empty($request->sub_job_id)) {
$this->show($request);
@ -43,40 +48,11 @@ class SubSubJobController extends Controller
}
/**
* Show the form for creating a new resource.
*/
public function create(){}
/**
* Store a newly created resource in storage.
*/
public function store(StoreSubSubJobRequest $request)
{
/*if (is_null($this->user) || !$this->user->can('masters.create')) {
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
}*/
// Validate the request...
$validated = $request->validated();
// Store the SubSubJob...
if($validated){
try{
SubSubJob::create($validated);
//return redirect()->route('job.index')->with('success', 'SubSubJob created successfully.');
echo json_encode(['status' => 'success', 'message' => 'Sub Sub Job created successfully.']);
}catch(\Exception $e){
//return redirect()->route('job.index')->with('error', 'SubSubJob created failed.');
echo json_encode(['status' => 'error', 'message' => 'Sub Sub Job created failed.']);
}
}
return false;
}
/**
* Display the specified resource.
* Lists the specified Sub Sub Job by Sub Job ID.
*
* @param \Illuminate\Http\Request $request
*
* @return void
*/
public function show(Request $request)
{
@ -94,10 +70,48 @@ class SubSubJobController extends Controller
echo json_encode($data);
}
/**
* Store a newly created Sub Sub Job in storage.
*
* @param \App\Http\Requests\StoreSubSubJobRequest $request
*
* @return false
*/
public function store(StoreSubSubJobRequest $request)
{
/*if (is_null($this->user) || !$this->user->can('masters.create')) {
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
}*/
// Validate the request...
$validated = $request->validated();
// Store the SubSubJob...
if ($validated) {
try {
SubSubJob::create($validated);
//return redirect()->route('job.index')->with('success', 'SubSubJob created successfully.');
echo json_encode(['status' => 'success', 'message' => 'Sub Sub Job created successfully.']);
} catch (Exception $e) {
//return redirect()->route('job.index')->with('error', 'SubSubJob created failed.');
echo json_encode(['status' => 'error', 'message' => 'Sub Sub Job created failed.']);
}
}
return false;
}
/**
* Show the form for creating a new resource.
*/
public function create() { }
/**
* Show the form for editing the specified resource.
*/
public function edit($id){
public function edit($id)
{
$subJob = SubSubJob::find($id);
echo json_encode($subJob);
}
@ -119,7 +133,7 @@ class SubSubJobController extends Controller
$subSubJob->update($validated);
//return redirect()->route('job.index')->with('success', 'SubSubJob updated successfully.');
echo json_encode(['status' => 'success', 'message' => 'Sub Sub Job updated successfully.']);
}catch(\Exception $e){
} catch (Exception $e) {
//return redirect()->route('job.index')->with('error', 'SubSubJob updated failed.');
echo json_encode(['status' => 'error', 'message' => 'Sub Sub Job updated failed.']);
}
@ -131,7 +145,8 @@ class SubSubJobController extends Controller
/**
* Remove the specified resource from storage.
*/
public function destroy(SubSubJob $subSubJob){
public function destroy(SubSubJob $subSubJob)
{
$subSubJob->delete();
echo json_encode(['status' => 'success', 'message' => 'Sub Sub Job deleted successfully.']);
//return redirect()->route('sub-job.index')->with('success', 'Sub Sub Job deleted successfully.');

124
composer.lock generated
View File

@ -691,22 +691,22 @@
},
{
"name": "guzzlehttp/guzzle",
"version": "7.5.0",
"version": "7.5.1",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
"reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba"
"reference": "b964ca597e86b752cd994f27293e9fa6b6a95ed9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/b50a2a1251152e43f6a37f0fa053e730a67d25ba",
"reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/b964ca597e86b752cd994f27293e9fa6b6a95ed9",
"reference": "b964ca597e86b752cd994f27293e9fa6b6a95ed9",
"shasum": ""
},
"require": {
"ext-json": "*",
"guzzlehttp/promises": "^1.5",
"guzzlehttp/psr7": "^1.9 || ^2.4",
"guzzlehttp/psr7": "^1.9.1 || ^2.4.5",
"php": "^7.2.5 || ^8.0",
"psr/http-client": "^1.0",
"symfony/deprecation-contracts": "^2.2 || ^3.0"
@ -799,7 +799,7 @@
],
"support": {
"issues": "https://github.com/guzzle/guzzle/issues",
"source": "https://github.com/guzzle/guzzle/tree/7.5.0"
"source": "https://github.com/guzzle/guzzle/tree/7.5.1"
},
"funding": [
{
@ -815,7 +815,7 @@
"type": "tidelift"
}
],
"time": "2022-08-28T15:39:27+00:00"
"time": "2023-04-17T16:30:08+00:00"
},
{
"name": "guzzlehttp/promises",
@ -903,22 +903,22 @@
},
{
"name": "guzzlehttp/psr7",
"version": "2.4.4",
"version": "2.5.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
"reference": "3cf1b6d4f0c820a2cf8bcaec39fc698f3443b5cf"
"reference": "b635f279edd83fc275f822a1188157ffea568ff6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/3cf1b6d4f0c820a2cf8bcaec39fc698f3443b5cf",
"reference": "3cf1b6d4f0c820a2cf8bcaec39fc698f3443b5cf",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/b635f279edd83fc275f822a1188157ffea568ff6",
"reference": "b635f279edd83fc275f822a1188157ffea568ff6",
"shasum": ""
},
"require": {
"php": "^7.2.5 || ^8.0",
"psr/http-factory": "^1.0",
"psr/http-message": "^1.0",
"psr/http-message": "^1.1 || ^2.0",
"ralouphie/getallheaders": "^3.0"
},
"provide": {
@ -938,9 +938,6 @@
"bamarni-bin": {
"bin-links": true,
"forward-command": false
},
"branch-alias": {
"dev-master": "2.4-dev"
}
},
"autoload": {
@ -1002,7 +999,7 @@
],
"support": {
"issues": "https://github.com/guzzle/psr7/issues",
"source": "https://github.com/guzzle/psr7/tree/2.4.4"
"source": "https://github.com/guzzle/psr7/tree/2.5.0"
},
"funding": [
{
@ -1018,7 +1015,7 @@
"type": "tidelift"
}
],
"time": "2023-03-09T13:19:02+00:00"
"time": "2023-04-17T16:11:26+00:00"
},
{
"name": "guzzlehttp/uri-template",
@ -1276,16 +1273,16 @@
},
{
"name": "laravel/framework",
"version": "v10.7.1",
"version": "v10.8.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "ddbbb2b50388721fe63312bb4469cae13163fd36"
"reference": "317d7ccaeb1bbf4ac3035efe225ef2746c45f3a8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/ddbbb2b50388721fe63312bb4469cae13163fd36",
"reference": "ddbbb2b50388721fe63312bb4469cae13163fd36",
"url": "https://api.github.com/repos/laravel/framework/zipball/317d7ccaeb1bbf4ac3035efe225ef2746c45f3a8",
"reference": "317d7ccaeb1bbf4ac3035efe225ef2746c45f3a8",
"shasum": ""
},
"require": {
@ -1472,7 +1469,7 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2023-04-11T14:11:49+00:00"
"time": "2023-04-18T13:45:33+00:00"
},
{
"name": "laravel/sanctum",
@ -1669,16 +1666,16 @@
},
{
"name": "laravelcollective/html",
"version": "v6.4.0",
"version": "v6.4.1",
"source": {
"type": "git",
"url": "https://github.com/LaravelCollective/html.git",
"reference": "ac74f580459a5120079b8def0404e5d312a09504"
"reference": "64ddfdcaeeb8d332bd98bef442bef81e39c3910b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/LaravelCollective/html/zipball/ac74f580459a5120079b8def0404e5d312a09504",
"reference": "ac74f580459a5120079b8def0404e5d312a09504",
"url": "https://api.github.com/repos/LaravelCollective/html/zipball/64ddfdcaeeb8d332bd98bef442bef81e39c3910b",
"reference": "64ddfdcaeeb8d332bd98bef442bef81e39c3910b",
"shasum": ""
},
"require": {
@ -1737,7 +1734,8 @@
"issues": "https://github.com/LaravelCollective/html/issues",
"source": "https://github.com/LaravelCollective/html"
},
"time": "2023-02-13T18:15:35+00:00"
"abandoned": "spatie/laravel-html",
"time": "2023-04-25T02:46:11+00:00"
},
{
"name": "league/commonmark",
@ -7350,16 +7348,16 @@
},
{
"name": "laravel/breeze",
"version": "v1.20.1",
"version": "v1.20.2",
"source": {
"type": "git",
"url": "https://github.com/laravel/breeze.git",
"reference": "bb2935f40d8396c6d0c77e4099a6e072c9095b33"
"reference": "b010ff3f8cd8e9ae2a2023ca323fba9987157f60"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/breeze/zipball/bb2935f40d8396c6d0c77e4099a6e072c9095b33",
"reference": "bb2935f40d8396c6d0c77e4099a6e072c9095b33",
"url": "https://api.github.com/repos/laravel/breeze/zipball/b010ff3f8cd8e9ae2a2023ca323fba9987157f60",
"reference": "b010ff3f8cd8e9ae2a2023ca323fba9987157f60",
"shasum": ""
},
"require": {
@ -7408,20 +7406,20 @@
"issues": "https://github.com/laravel/breeze/issues",
"source": "https://github.com/laravel/breeze"
},
"time": "2023-03-28T14:37:27+00:00"
"time": "2023-04-16T20:27:51+00:00"
},
{
"name": "laravel/pint",
"version": "v1.8.0",
"version": "v1.9.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/pint.git",
"reference": "4b8f2ef22bfcddd1d163cfd282e3f42ee1a5cce2"
"reference": "eac5ec3d6b5c96543c682e309a10fdddc9f61d80"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/pint/zipball/4b8f2ef22bfcddd1d163cfd282e3f42ee1a5cce2",
"reference": "4b8f2ef22bfcddd1d163cfd282e3f42ee1a5cce2",
"url": "https://api.github.com/repos/laravel/pint/zipball/eac5ec3d6b5c96543c682e309a10fdddc9f61d80",
"reference": "eac5ec3d6b5c96543c682e309a10fdddc9f61d80",
"shasum": ""
},
"require": {
@ -7474,7 +7472,7 @@
"issues": "https://github.com/laravel/pint/issues",
"source": "https://github.com/laravel/pint"
},
"time": "2023-04-04T13:08:09+00:00"
"time": "2023-04-18T14:50:44+00:00"
},
{
"name": "laravel/sail",
@ -7674,16 +7672,16 @@
},
{
"name": "nunomaduro/collision",
"version": "v7.5.0",
"version": "v7.5.2",
"source": {
"type": "git",
"url": "https://github.com/nunomaduro/collision.git",
"reference": "bbbc6fb9c1ee88f8aa38e47abd15c465f946f85e"
"reference": "76b3cabda0aabda455fc3b9db6c3615f5a87c7ff"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nunomaduro/collision/zipball/bbbc6fb9c1ee88f8aa38e47abd15c465f946f85e",
"reference": "bbbc6fb9c1ee88f8aa38e47abd15c465f946f85e",
"url": "https://api.github.com/repos/nunomaduro/collision/zipball/76b3cabda0aabda455fc3b9db6c3615f5a87c7ff",
"reference": "76b3cabda0aabda455fc3b9db6c3615f5a87c7ff",
"shasum": ""
},
"require": {
@ -7693,19 +7691,19 @@
"symfony/console": "^6.2.8"
},
"conflict": {
"phpunit/phpunit": "<10.1.0"
"phpunit/phpunit": "<10.1.2"
},
"require-dev": {
"brianium/paratest": "^7.1.3",
"laravel/framework": "^10.7.1",
"laravel/pint": "^1.8.0",
"laravel/framework": "^10.8.0",
"laravel/pint": "^1.9.0",
"laravel/sail": "^1.21.4",
"laravel/sanctum": "^3.2.1",
"laravel/tinker": "^2.8.1",
"nunomaduro/larastan": "^2.5.1",
"orchestra/testbench-core": "^8.4.2",
"pestphp/pest": "^2.5.0",
"phpunit/phpunit": "^10.1.0",
"nunomaduro/larastan": "^2.6.0",
"orchestra/testbench-core": "^8.5.0",
"pestphp/pest": "^2.5.2",
"phpunit/phpunit": "^10.1.1",
"sebastian/environment": "^6.0.1",
"spatie/laravel-ignition": "^2.1.0"
},
@ -7766,7 +7764,7 @@
"type": "patreon"
}
],
"time": "2023-04-14T10:39:16+00:00"
"time": "2023-04-22T22:12:40+00:00"
},
{
"name": "phar-io/manifest",
@ -7881,16 +7879,16 @@
},
{
"name": "phpunit/php-code-coverage",
"version": "10.1.0",
"version": "10.1.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "fc4f5ee614fa82d50ecf9014b51af0a9561f3df8"
"reference": "884a0da7f9f46f28b2cb69134217fd810b793974"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/fc4f5ee614fa82d50ecf9014b51af0a9561f3df8",
"reference": "fc4f5ee614fa82d50ecf9014b51af0a9561f3df8",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/884a0da7f9f46f28b2cb69134217fd810b793974",
"reference": "884a0da7f9f46f28b2cb69134217fd810b793974",
"shasum": ""
},
"require": {
@ -7909,7 +7907,7 @@
"theseer/tokenizer": "^1.2.0"
},
"require-dev": {
"phpunit/phpunit": "^10.0"
"phpunit/phpunit": "^10.1"
},
"suggest": {
"ext-pcov": "PHP extension that provides line coverage",
@ -7947,7 +7945,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
"security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.0"
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.1"
},
"funding": [
{
@ -7955,7 +7953,7 @@
"type": "github"
}
],
"time": "2023-04-13T07:08:27+00:00"
"time": "2023-04-17T12:15:40+00:00"
},
{
"name": "phpunit/php-file-iterator",
@ -8200,16 +8198,16 @@
},
{
"name": "phpunit/phpunit",
"version": "10.1.0",
"version": "10.1.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "5a477aea03e61329132935689ae2d73f418f5e25"
"reference": "6f0cd95be71add539f8fd2be25b2a4a29789000b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/5a477aea03e61329132935689ae2d73f418f5e25",
"reference": "5a477aea03e61329132935689ae2d73f418f5e25",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6f0cd95be71add539f8fd2be25b2a4a29789000b",
"reference": "6f0cd95be71add539f8fd2be25b2a4a29789000b",
"shasum": ""
},
"require": {
@ -8223,7 +8221,7 @@
"phar-io/manifest": "^2.0.3",
"phar-io/version": "^3.0.2",
"php": ">=8.1",
"phpunit/php-code-coverage": "^10.1",
"phpunit/php-code-coverage": "^10.1.1",
"phpunit/php-file-iterator": "^4.0",
"phpunit/php-invoker": "^4.0",
"phpunit/php-text-template": "^3.0",
@ -8281,7 +8279,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"security": "https://github.com/sebastianbergmann/phpunit/security/policy",
"source": "https://github.com/sebastianbergmann/phpunit/tree/10.1.0"
"source": "https://github.com/sebastianbergmann/phpunit/tree/10.1.2"
},
"funding": [
{
@ -8297,7 +8295,7 @@
"type": "tidelift"
}
],
"time": "2023-04-14T05:15:09+00:00"
"time": "2023-04-22T07:38:19+00:00"
},
{
"name": "sebastian/cli-parser",

View File

@ -1,5 +1,6 @@
<?php
use App\Http\Controllers\DirectoratController;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
@ -17,3 +18,5 @@ use Illuminate\Support\Facades\Route;
Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
return $request->user();
});
Route::get('directorat',[DirectoratController::class, 'index']);