forked from nabeelio/phpvms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into bug-fix-nabeelio#1275
- Loading branch information
Showing
101 changed files
with
1,491 additions
and
210 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
20 changes: 20 additions & 0 deletions
20
app/Database/migrations/2023_08_11_225426_add_email_verified_to_user.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,20 @@ | ||
<?php | ||
|
||
use App\Models\User; | ||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class() extends Migration { | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
Schema::table('users', function (Blueprint $table) { | ||
$table->timestamp('email_verified_at')->nullable(); | ||
}); | ||
|
||
User::where('email_verified_at', null)->update(['email_verified_at' => now()]); | ||
} | ||
}; |
27 changes: 27 additions & 0 deletions
27
app/Database/migrations/2023_08_14_074828_add_aircraft_id_to_bids.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,27 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class() extends Migration { | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
Schema::table('bids', function (Blueprint $table) { | ||
$table->unsignedInteger('aircraft_id')->nullable()->after('flight_id'); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::table('bids', function (Blueprint $table) { | ||
$table->dropColumn('aircraft_id'); | ||
}); | ||
} | ||
}; |
20 changes: 20 additions & 0 deletions
20
app/Database/migrations/2023_08_22_192218_create_data_migrations_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,20 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
// Add events table and update flights & pirep tables for references | ||
return new class() extends Migration { | ||
public function up() | ||
{ | ||
// Create events table | ||
if (!Schema::hasTable('migrations_data')) { | ||
Schema::create('migrations_data', function (Blueprint $table) { | ||
$table->increments('id'); | ||
$table->string('migration', 191); | ||
$table->integer('batch'); | ||
}); | ||
} | ||
} | ||
}; |
File renamed without changes.
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,43 @@ | ||
<?php | ||
|
||
namespace App\Exceptions; | ||
|
||
use App\Models\Aircraft; | ||
|
||
class BidExistsForAircraft extends AbstractHttpException | ||
{ | ||
public function __construct( | ||
private readonly Aircraft $aircraft | ||
) { | ||
parent::__construct( | ||
409, | ||
'A bid already exists for this aircraft' | ||
); | ||
} | ||
|
||
/** | ||
* Return the RFC 7807 error type (without the URL root) | ||
*/ | ||
public function getErrorType(): string | ||
{ | ||
return 'bid-exists'; | ||
} | ||
|
||
/** | ||
* Get the detailed error string | ||
*/ | ||
public function getErrorDetails(): string | ||
{ | ||
return $this->getMessage(); | ||
} | ||
|
||
/** | ||
* Return an array with the error details, merged with the RFC7807 response | ||
*/ | ||
public function getErrorMetadata(): array | ||
{ | ||
return [ | ||
'aircraft_id' => $this->aircraft->id, | ||
]; | ||
} | ||
} |
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
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
Oops, something went wrong.