-
-
Notifications
You must be signed in to change notification settings - Fork 27
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 #135 from justdlabs/laravel-11.x
Laravel 11.x
- Loading branch information
Showing
68 changed files
with
2,416 additions
and
2,044 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
### TL;DR | ||
### TL;DR | ||
|
||
```bash | ||
composer create-project justd/laravel your-project-name | ||
|
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,80 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"vcs": { | ||
"enabled": false, | ||
"clientKind": "git", | ||
"useIgnoreFile": false | ||
}, | ||
"files": { | ||
"ignoreUnknown": false, | ||
"ignore": ["vendor", "node_modules", "resources/js/ziggy.js"] | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": true, | ||
"style": { | ||
"noNonNullAssertion": "off", | ||
"noParameterAssign": "warn", | ||
"useImportType": "error" | ||
}, | ||
"complexity": { | ||
"useArrowFunction": "error" | ||
}, | ||
"a11y": { | ||
"noSvgWithoutTitle": "off", | ||
"useValidAnchor": "off", | ||
"useSemanticElements": "off" | ||
}, | ||
"correctness": { | ||
"useHookAtTopLevel": "error", | ||
"noUnusedImports": "error", | ||
"useExhaustiveDependencies": "off", | ||
"noChildrenProp": "off" | ||
}, | ||
"suspicious": { | ||
"noExplicitAny": "off", | ||
"noArrayIndexKey": "off", | ||
"noConsoleLog": "warn" | ||
}, | ||
"nursery": { | ||
"useSortedClasses": { | ||
"level": "error", | ||
"fix": "safe", | ||
"options": { | ||
"attributes": ["classList"], | ||
"functions": ["cn", "twJoin", "tv", "composeRenderProps", "composeTailwindRenderProps"] | ||
} | ||
} | ||
} | ||
}, | ||
"ignore": [] | ||
}, | ||
"formatter": { | ||
"enabled": true, | ||
"indentStyle": "space", | ||
"indentWidth": 2, | ||
"lineWidth": 100, | ||
"ignore": [] | ||
}, | ||
"javascript": { | ||
"formatter": { | ||
"quoteStyle": "double", | ||
"arrowParentheses": "always", | ||
"bracketSameLine": false, | ||
"bracketSpacing": true, | ||
"jsxQuoteStyle": "double", | ||
"quoteProperties": "asNeeded", | ||
"semicolons": "asNeeded", | ||
"trailingCommas": "all" | ||
} | ||
}, | ||
"json": { | ||
"formatter": { | ||
"trailingCommas": "none" | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,32 +1,33 @@ | ||
import '../css/app.css'; | ||
import './bootstrap'; | ||
import "../css/app.css" | ||
import "./bootstrap" | ||
|
||
import { Providers } from '@/components/providers'; | ||
import { Ziggy } from '@/ziggy'; | ||
import { createInertiaApp } from '@inertiajs/react'; | ||
import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers'; | ||
import { createRoot, hydrateRoot } from 'react-dom/client'; | ||
import { useRoute } from 'ziggy-js'; | ||
import { Providers } from "@/components/providers" | ||
import { Ziggy } from "@/ziggy" | ||
import { createInertiaApp } from "@inertiajs/react" | ||
import { resolvePageComponent } from "laravel-vite-plugin/inertia-helpers" | ||
import { createRoot, hydrateRoot } from "react-dom/client" | ||
import { useRoute } from "ziggy-js" | ||
|
||
const appName = import.meta.env.VITE_APP_NAME || 'Laravel'; | ||
const appName = import.meta.env.VITE_APP_NAME || "Laravel" | ||
|
||
createInertiaApp({ | ||
title: (title) => (title ? title + ' / ' + appName : appName), | ||
resolve: (name) => resolvePageComponent(`./pages/${name}.tsx`, import.meta.glob('./pages/**/*.tsx')), | ||
title: (title) => (title ? `${title} / ${appName}` : appName), | ||
resolve: (name) => | ||
resolvePageComponent(`./pages/${name}.tsx`, import.meta.glob("./pages/**/*.tsx")), | ||
setup({ el, App, props }) { | ||
// @ts-expect-error | ||
window.route = useRoute(Ziggy as any); | ||
window.route = useRoute(Ziggy as any) | ||
const appElement = ( | ||
<Providers> | ||
<App {...props} /> | ||
</Providers> | ||
); | ||
) | ||
if (import.meta.env.SSR) { | ||
hydrateRoot(el, appElement); | ||
return; | ||
hydrateRoot(el, appElement) | ||
return | ||
} | ||
|
||
createRoot(el).render(appElement); | ||
createRoot(el).render(appElement) | ||
}, | ||
progress: false | ||
}); | ||
progress: false, | ||
}) |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import axios from 'axios'; | ||
import axios from "axios" | ||
|
||
window.axios = axios; | ||
window.axios = axios | ||
|
||
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; | ||
window.axios.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest" |
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 |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import { FlashMessageData } from '@/types/index'; | ||
import { usePage } from '@inertiajs/react'; | ||
import { useEffect } from 'react'; | ||
import { toast } from 'sonner'; | ||
import { Toast } from 'ui'; | ||
import type { FlashMessageData } from "@/types" | ||
import { usePage } from "@inertiajs/react" | ||
import { useEffect } from "react" | ||
import { toast } from "sonner" | ||
import { Toast } from "ui" | ||
|
||
export function FlashMessage() { | ||
const { flash_message } = usePage<{ flash_message: FlashMessageData }>().props; | ||
const { flash_message } = usePage<{ flash_message: FlashMessageData }>().props | ||
useEffect(() => { | ||
if (flash_message && flash_message.message) { | ||
(toast as any)[flash_message.type](flash_message.message); | ||
if (flash_message?.message) { | ||
;(toast as any)[flash_message.type](flash_message.message) | ||
} | ||
}, [flash_message]); | ||
return <Toast />; | ||
}, [flash_message]) | ||
return <Toast /> | ||
} |
Oops, something went wrong.