Last active
June 16, 2025 12:37
-
-
Save johnRivs/b324ca653b138417c7916e0e049ca9b2 to your computer and use it in GitHub Desktop.
Laravel stuff for every project
This file contains hidden or 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
Model::unguard(); | |
RequestException::dontTruncate(); | |
Date::use(CarbonImmutable::class); | |
Vite::prefetch(concurrency: 3); | |
Model::automaticallyEagerLoadRelationships(); | |
// how does this play with Model::preventLazyLoading();? | |
// is there a way to opt out on a given query? in case i want to ->with('user:id,name') | |
Url::forceHttps($this->app->isProduction()); | |
Inertia::share([ | |
'flash' => [ | |
'message' => fn () => session()->get('flash.message'), | |
], | |
]); | |
if (! $this->app->isProduction()) { | |
Model::preventLazyLoading(); | |
DB::enableQueryLog(); | |
DB::whenQueryingForLongerThan(300, function($connection) { | |
Log::warning('Long running queries detected.', $connection->getQuerylog()); | |
}); | |
} else { | |
DB::prohibitDestructiveCommands(); | |
} |
This file contains hidden or 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
tests | |
without vite | |
without exception handling | |
laravel debugbar | |
log viewer https://github.com/opcodesio/log-viewer | |
email errors | |
attach request, context and other relevant data | |
telescope locally | |
https://laracasts.com/series/build-shopify-apps-with-laravel/episodes/7 | |
https://laracasts.com/series/learn-telescope | |
https://github.com/tnylea/php-ext | |
vite-image-processor-plugin | |
whenQueryingForLongerThan shouldn't happen when seeding |
This file contains hidden or 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
build: { | |
rollupOptions: { | |
output: { | |
manualChunks(path) { | |
if (path.includes('node_modules')) return 'vendor'; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment