Skip to content

Commit 857c235

Browse files
committed
Multi DB connection support
1 parent 07fa023 commit 857c235

File tree

8 files changed

+32
-13
lines changed

8 files changed

+32
-13
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"license": "MIT",
2020
"devDependencies": {
2121
"autoprefixer": "^10.4.4",
22-
"laravel-mix": "^6.0.43",
22+
"laravel-mix": "^6.0.49",
2323
"postcss": "^8.4.12",
2424
"resolve-url-loader": "^5.0.0",
2525
"sass": "^1.67.0",

postcss.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
plugins: [
3+
require('tailwindcss'),
4+
require('autoprefixer'),
5+
]
6+
}

src/ModelResolver.php

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,13 @@ class_uses_recursive($className),
5353
private function registerModels(string $path): void
5454
{
5555
// caching the models
56-
$this->models = Cache::remember(
57-
$this->getCacheKey(),
58-
now()->addDay(),
59-
fn () => $this->extractFromFolder($path)
60-
);
56+
$this->models = app()->environment('production') ?
57+
Cache::remember(
58+
$this->getCacheKey(),
59+
now()->addDay(),
60+
fn () => $this->extractFromFolder($path)
61+
) :
62+
$this->extractFromFolder($path);
6163
}
6264

6365
public function getCacheKey(): string
@@ -192,7 +194,10 @@ public function getColumns(string $type): array
192194
SELECT
193195
COLUMN_NAME AS field,
194196
COLUMN_TYPE AS type,
195-
IS_NULLABLE AS is_null
197+
CASE
198+
WHEN IS_NULLABLE = 'YES' THEN 1
199+
ELSE 0
200+
END AS is_null
196201
FROM INFORMATION_SCHEMA.COLUMNS
197202
WHERE
198203
TABLE_NAME = '$table' AND
@@ -204,7 +209,10 @@ public function getColumns(string $type): array
204209
SELECT
205210
c.column_name AS field,
206211
c.udt_name AS type,
207-
c.is_nullable AS is_null
212+
CASE
213+
WHEN c.is_nullable = 'YES' THEN TRUE
214+
ELSE FALSE
215+
END AS is_null
208216
FROM information_schema.columns c
209217
LEFT JOIN
210218
pg_attribute attr ON attr.attrelid = '$table'::regclass AND attr.attname = c.column_name AND attr.atthasdef

src/resources/assets/css/app.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/resources/assets/js/app.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/resources/assets/js/foreign-selection.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/resources/assets/js/type-index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
{}
1+
{
2+
"/js/app.js": "/js/app.js",
3+
"/js/type-index.js": "/js/type-index.js",
4+
"/js/foreign-selection.js": "/js/foreign-selection.js",
5+
"/css/app.css": "/css/app.css"
6+
}

0 commit comments

Comments
 (0)