-
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.
Add new mappings for Laravel 11 Fixes 71 & some minor fixes (#72)
* Update TypescriptMappings.php add new mappings for laravel 11 * add Complex Model Create Complex Model with table to use in tests * Update GetModelsTest.php * Add test for Complex Model Add test for Complex Model and expectations * run pint * fix composer i warnings The lock file is not up to date with the latest changes in composer.json, replace nunomaduro/larastan with larastan/larastan * rerun composer pint with new pint version * Fix PHPStan error Key'type' on array $interfaces always exists and is not nullable, as is set as 'unknown' on line 46
- Loading branch information
1 parent
cf50033
commit dd252e6
Showing
14 changed files
with
905 additions
and
741 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
Large diffs are not rendered by default.
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 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
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,33 @@ | ||
export interface Complex { | ||
// columns | ||
id: number | ||
big_integer: number | ||
binary: unknown | ||
boolean: boolean | ||
char: string | ||
date_time: string | ||
date: string | ||
decimal: number | ||
double: number | ||
enum: string | ||
float: number | ||
integer: number | ||
ip_address: string | ||
json: Record<string, unknown> | ||
jsonb: Record<string, unknown> | ||
long_text: string | ||
mac_address: string | ||
medium_integer: number | ||
medium_text: string | ||
small_integer: number | ||
string: string | ||
text: string | ||
time: string | ||
timestamp: string | ||
year: number | ||
uuid: string | ||
ulid: string | ||
created_at: string|null | ||
updated_at: string|null | ||
deleted_at: string|null | ||
} |
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,16 @@ | ||
<?php | ||
|
||
namespace App\Models; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class Complex extends Model | ||
{ | ||
protected $table = 'complex_model_table'; | ||
|
||
protected $casts = [ | ||
'json' => 'json', | ||
'jsonb' => 'json', | ||
'year' => 'int', | ||
]; | ||
} |
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
46 changes: 46 additions & 0 deletions
46
test/laravel-skeleton/database/migrations/0000_00_00_100000_create_complex_model_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,46 @@ | ||
<?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::create('complex_model_table', function (Blueprint $table) { | ||
$table->id(); | ||
$table->bigInteger('bigInteger'); | ||
$table->binary('binary'); | ||
$table->boolean('boolean'); | ||
$table->char('char'); | ||
$table->dateTime('dateTime'); | ||
$table->date('date'); | ||
$table->decimal('decimal'); | ||
$table->double('double'); | ||
$table->enum('enum', [1, 2, 3, 'A', 'B']); | ||
$table->float('float'); | ||
$table->integer('integer'); | ||
$table->ipAddress('ipAddress'); | ||
$table->json('json'); | ||
$table->jsonb('jsonb'); | ||
$table->longText('longText'); | ||
$table->macAddress('macAddress'); | ||
$table->mediumInteger('mediumInteger'); | ||
$table->mediumText('mediumText'); | ||
$table->smallInteger('smallInteger'); | ||
$table->string('string'); | ||
$table->text('text'); | ||
$table->time('time'); | ||
$table->timestamp('timestamp'); | ||
$table->year('year'); | ||
$table->uuid('uuid'); | ||
$table->ulid('ulid'); | ||
$table->timestamps(); | ||
$table->softDeletes(); | ||
}); | ||
} | ||
}; |