-
Notifications
You must be signed in to change notification settings - Fork 903
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5457 from Laravel-Backpack/l11
Add Laravel 11 support
- Loading branch information
Showing
12 changed files
with
220 additions
and
60 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
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,65 @@ | ||
<?php | ||
|
||
namespace Backpack\CRUD\app\Library\Database; | ||
|
||
final class Table | ||
{ | ||
private array $columns; | ||
|
||
public function __construct(array $columns = []) | ||
{ | ||
foreach ($columns as $column) { | ||
$this->columns[$column['name']] = new class($column) | ||
{ | ||
public function __construct(private array $column) | ||
{ | ||
} | ||
|
||
public function getName() | ||
{ | ||
return $this->column['name']; | ||
} | ||
|
||
public function getNotnull() | ||
{ | ||
return ! $this->column['nullable']; | ||
} | ||
|
||
public function getDefault() | ||
{ | ||
return $this->column['default']; | ||
} | ||
|
||
public function getType() | ||
{ | ||
return new class($this->column) | ||
{ | ||
public function __construct(private array $column) | ||
{ | ||
} | ||
|
||
public function getName() | ||
{ | ||
return $this->column['type_name']; | ||
} | ||
}; | ||
} | ||
}; | ||
} | ||
} | ||
|
||
public function getColumns() | ||
{ | ||
return $this->columns; | ||
} | ||
|
||
public function hasColumn(string $columnName) | ||
{ | ||
return isset($this->columns[$columnName]); | ||
} | ||
|
||
public function getColumn(string $columnName) | ||
{ | ||
return $this->columns[$columnName]; | ||
} | ||
} |
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.