-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5c9ec75
commit a299913
Showing
23 changed files
with
580 additions
and
124 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
60 changes: 60 additions & 0 deletions
60
Database/migrations/2024_02_11_065647_create_ch_trip_templates_table.php
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,60 @@ | ||
<?php | ||
|
||
use App\Contracts\Migration; | ||
use Illuminate\Support\Facades\Schema; | ||
use Illuminate\Database\Schema\Blueprint; | ||
|
||
/** | ||
* Class CreateChTripTemplatesTable | ||
*/ | ||
class CreateChTripTemplatesTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
// Allow Multiple Users to be assigned to a trip. | ||
Schema::create('trip_report_user', function (Blueprint $table) { | ||
$table->string('trip_report_id'); | ||
$table->foreignId('user_id'); | ||
$table->boolean('owner'); | ||
}); | ||
// Convert Users from old trip ownership to new one. | ||
//$tr = \Modules\CHTrips\Models\TripReport::all(); | ||
//$user_id = $tr->owner_id; | ||
//$tr->users()->attach($user_id, ['owner' => true]); | ||
|
||
// Add Trip Templates | ||
Schema::create('ch_trip_templates', function (Blueprint $table) { | ||
$table->increments('id'); | ||
$table->string('name'); | ||
$table->boolean('visible')->default(true); | ||
$table->boolean('enabled')->default(true); | ||
$table->longText('description')->nullable(); | ||
$table->integer('type')->nullable(); | ||
$table->json('data'); // List of all the flights to be generated for this trip. | ||
$table->date('starting_at')->nullable(); | ||
$table->date('ending_at')->nullable(); | ||
$table->timestamps(); | ||
$table->softDeletes(); | ||
}); | ||
Schema::table('ch_trip_reports', function (Blueprint $table) { | ||
$table->boolean('can_duplicate'); // Allows trip to be duplicated by another user so they can fly a similar trip. | ||
//$table->foreignId('owner_id')->nullable()->change(); // Allow trip to be claimed by users. | ||
$table->dropColumn('owner_id'); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::dropIfExists('ch_trip_templates'); | ||
} | ||
} |
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,87 @@ | ||
<?php | ||
|
||
namespace Modules\CHTrips\Http\Controllers\Admin; | ||
|
||
use App\Contracts\Controller; | ||
use Illuminate\Http\Request; | ||
|
||
/** | ||
* Admin controller | ||
*/ | ||
class MissionAdminController extends Controller | ||
{ | ||
/** | ||
* Display a listing of the resource. | ||
* | ||
* @param Request $request | ||
* | ||
* @return mixed | ||
*/ | ||
public function index(Request $request) | ||
{ | ||
return view('chtrips::admin.index'); | ||
} | ||
|
||
/** | ||
* Show the form for creating a new resource. | ||
* | ||
* @param Request $request | ||
* | ||
* @return mixed | ||
*/ | ||
public function create(Request $request) | ||
{ | ||
return view('chtrips::admin.create'); | ||
} | ||
|
||
/** | ||
* Store a newly created resource in storage. | ||
* | ||
* @param Request $request | ||
*/ | ||
public function store(Request $request) | ||
{ | ||
} | ||
|
||
/** | ||
* Show the form for editing the specified resource. | ||
* | ||
* @param Request $request | ||
* | ||
* @return mixed | ||
*/ | ||
public function edit(Request $request) | ||
{ | ||
return view('chtrips::admin.edit'); | ||
} | ||
|
||
/** | ||
* Show the specified resource. | ||
* | ||
* @param Request $request | ||
* | ||
* @return mixed | ||
*/ | ||
public function show(Request $request) | ||
{ | ||
return view('chtrips::admin.show'); | ||
} | ||
|
||
/** | ||
* Update the specified resource in storage. | ||
* | ||
* @param Request $request | ||
*/ | ||
public function update(Request $request) | ||
{ | ||
} | ||
|
||
/** | ||
* Remove the specified resource from storage. | ||
* | ||
* @param Request $request | ||
*/ | ||
public function destroy(Request $request) | ||
{ | ||
} | ||
} |
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,89 @@ | ||
<?php | ||
|
||
namespace Modules\CHTrips\Http\Controllers\Admin; | ||
|
||
use App\Contracts\Controller; | ||
use Illuminate\Http\Request; | ||
use Modules\CHTrips\Models\TripTemplate; | ||
|
||
/** | ||
* Admin controller | ||
*/ | ||
class TripTemplatesAdminController extends Controller | ||
{ | ||
/** | ||
* Display a listing of the resource. | ||
* | ||
* @param Request $request | ||
* | ||
* @return mixed | ||
*/ | ||
public function index(Request $request) | ||
{ | ||
return view('chtrips::admin.index'); | ||
} | ||
|
||
/** | ||
* Show the form for creating a new resource. | ||
* | ||
* @param Request $request | ||
* | ||
* @return mixed | ||
*/ | ||
public function create(Request $request) | ||
{ | ||
return view('chtrips::admin.create'); | ||
} | ||
|
||
/** | ||
* Store a newly created resource in storage. | ||
* | ||
* @param Request $request | ||
*/ | ||
public function store(Request $request) | ||
{ | ||
} | ||
|
||
/** | ||
* Show the form for editing the specified resource. | ||
* | ||
* @param Request $request | ||
* | ||
* @return mixed | ||
*/ | ||
public function edit(Request $request, TripTemplate $id) | ||
{ | ||
return view('chtrips::admin.edit'); | ||
} | ||
|
||
/** | ||
* Show the specified resource. | ||
* | ||
* @param Request $request | ||
* | ||
* @return mixed | ||
*/ | ||
public function show(Request $request, TripTemplate $id) | ||
{ | ||
return view('chtrips::admin.show'); | ||
} | ||
|
||
/** | ||
* Update the specified resource in storage. | ||
* | ||
* @param Request $request | ||
*/ | ||
public function update(Request $request, TripTemplate $id) | ||
{ | ||
} | ||
|
||
/** | ||
* Remove the specified resource from storage. | ||
* | ||
* @param Request $request | ||
*/ | ||
public function destroy(Request $request, TripTemplate $id) | ||
{ | ||
$id->delete(); | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.