-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update framework to laravel version 9 and update the airtable api key…
… to access token base
- Loading branch information
1 parent
cdb868b
commit 43d8606
Showing
112 changed files
with
11,106 additions
and
3,427 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\backend; | ||
|
||
use App\Http\Controllers\Controller; | ||
use App\Model\AddressType; | ||
use Illuminate\Http\Request; | ||
use Illuminate\Support\Facades\Auth; | ||
use Illuminate\Support\Facades\DB; | ||
|
||
class AddressTypeController extends Controller | ||
{ | ||
/** | ||
* Display a listing of the resource. | ||
* | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function index() | ||
{ | ||
$addressTypes = AddressType::cursor(); | ||
return view('backEnd.address_types.index', compact('addressTypes')); | ||
} | ||
|
||
/** | ||
* Show the form for creating a new resource. | ||
* | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function create() | ||
{ | ||
return view('backEnd.address_types.create'); | ||
} | ||
|
||
/** | ||
* Store a newly created resource in storage. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function store(Request $request) | ||
{ | ||
$this->validate($request, [ | ||
'type' => 'required|unique:address_types,type' | ||
]); | ||
try { | ||
DB::beginTransaction(); | ||
AddressType::create([ | ||
'type' => $request->type, | ||
'created_by' => Auth::id() | ||
]); | ||
DB::commit(); | ||
return redirect()->to('address_types')->with('success', 'Address type created successfully'); | ||
} catch (\Throwable $th) { | ||
DB::rollBack(); | ||
|
||
return redirect()->to('address_types')->with('error', $th->getMessage()); | ||
} | ||
} | ||
|
||
/** | ||
* Display the specified resource. | ||
* | ||
* @param int $id | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function show($id) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Show the form for editing the specified resource. | ||
* | ||
* @param int $id | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function edit($id) | ||
{ | ||
$addressType = AddressType::whereId($id)->first(); | ||
return view('backEnd.address_types.edit', compact('addressType')); | ||
} | ||
|
||
/** | ||
* Update the specified resource in storage. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @param int $id | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function update(Request $request, $id) | ||
{ | ||
$this->validate($request, [ | ||
'type' => 'required|unique:address_types,id,' . $id | ||
]); | ||
try { | ||
AddressType::whereId($id)->update([ | ||
'type' => $request->type | ||
]); | ||
DB::commit(); | ||
return redirect()->to('address_types')->with('success', 'Address type updated successfully'); | ||
} catch (\Throwable $th) { | ||
DB::rollBack(); | ||
return redirect()->to('address_types')->with('error', $th->getMessage()); | ||
} | ||
} | ||
|
||
/** | ||
* Remove the specified resource from storage. | ||
* | ||
* @param int $id | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function destroy($id) | ||
{ | ||
try { | ||
AddressType::whereId($id)->delete(); | ||
return redirect()->to('address_types')->with('success', 'Address type Deleted successfully'); | ||
} catch (\Throwable $th) { | ||
DB::rollBack(); | ||
return redirect()->to('address_types')->with('error', $th->getMessage()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\backend; | ||
|
||
use App\Http\Controllers\Controller; | ||
use App\Services\CostOptionService; | ||
use Illuminate\Http\Request; | ||
|
||
class CostOptionController extends Controller | ||
{ | ||
protected $costOptionService; | ||
|
||
public function __construct(CostOptionService $costOptionService) | ||
{ | ||
$this->costOptionService = $costOptionService; | ||
} | ||
|
||
public function airtable_v3($access_token, $base_url) | ||
{ | ||
$this->costOptionService->import_airtable_v3($access_token, $base_url); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\backend; | ||
|
||
use App\Http\Controllers\Controller; | ||
use App\Services\FundingService; | ||
use Illuminate\Http\Request; | ||
|
||
class FundingController extends Controller | ||
{ | ||
protected $fundingService; | ||
|
||
public function __construct(FundingService $fundingService) | ||
{ | ||
$this->fundingService = $fundingService; | ||
} | ||
|
||
public function airtable_v3($access_token, $base_url) | ||
{ | ||
$this->fundingService->import_airtable_v3($access_token, $base_url); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\backend; | ||
|
||
use App\Http\Controllers\Controller; | ||
use App\Services\IdentifierService; | ||
use Illuminate\Http\Request; | ||
|
||
class IdentifierController extends Controller | ||
{ | ||
protected $identifierService; | ||
|
||
public function __construct(IdentifierService $identifierService) | ||
{ | ||
$this->identifierService = $identifierService; | ||
} | ||
|
||
public function airtable_v3($access_token, $base_url) | ||
{ | ||
$this->identifierService->import_airtable_v3($access_token, $base_url); | ||
} | ||
} |
Oops, something went wrong.