Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Running Laraval framework-based web applications for long years 🪘

NotificationsYou must be signed in to change notification settings

szepeviktor/running-laravel

Repository files navigation

theories

🚧 list features -> orgranize them into categories, see GH issue!

ErrorDocument500 /errors/HTTP_INTERNAL_SERVER_ERROR.htmlErrorDocument503 /errors/HTTP_SERVICE_UNAVAILABLE.html# https://templates.mailchimp.com/resources/inline-css/Alias"/storage/""/home/${SITE_USER}/website/code/storage/app/public/"

mysqldump --routines --triggers --events

Setting up GitHub repository

Entry points

Startup methods.

  1. Web - throughpublic/index.php
  2. CLI - throughartisan
  3. Queue workers - throughartisan queue:work
  4. Cron job - throughartisan schedule:run

Security

  • HTTP method not in routes
  • HTTP 404
  • CSRF token mismatch (Google Translate, Facebook app, Google Search "Cached")
  • Failed login attempts
  • Requests for .php files
  • Non-empty hidden field in forms

Security Exceptions

protected$securityExceptions = [        \Illuminate\Session\TokenMismatchException::class,        \Illuminate\Validation\ValidationException::class,        \Illuminate\Auth\Access\AuthorizationException::class,        \Illuminate\Database\Eloquent\ModelNotFoundException::class,        \Symfony\Component\HttpKernel\Exception\HttpException::class,        \Symfony\Component\HttpKernel\Exception\NotFoundHttpException::class,];

Caches

UseRedis PECL extension instead of Predis,and thekey hash tag.

  • Compiled classes/bootstrap/cache/compiled.phpremoved in 5.4
  • Services/bootstrap/cache/services.php - flushed in composer scriptpost-autoload-dump
  • Discovered packages/bootstrap/cache/packages.php - flushed in composer scriptpost-autoload-dump
  • Configuration cache/bootstrap/cache/config.php - flushed byartisan config:clear
  • Routes cache/bootstrap/cache/routes.php - flushed byartisan route:clear
  • Events cache/bootstrap/cache/events.php - flushed byartisan event:clear
  • Application cache (CACHE_DRIVER) - flushed byartisan cache:clear
  • Blade templates cache/storage/framework/views/*.php - flushed byartisan view:clear

See/vendor/laravel/framework/src/Illuminate/Foundation/Application.php

Caching depends onAPP_ENV variable.

Static analysis

Throttle 404 errors

routes/web.php

useIlluminate\Support\Facades\Route;useSymfony\Component\HttpKernel\Exception\NotFoundHttpException;// Throttle 404 errorsRoute::fallback(staticfunction () {thrownewNotFoundHttpException();})->middleware('throttle:10,1');

Is Laravel down?

  1. ./artisan tinker --execute='printf("Application is %s.",App::isDownForMaintenance()?"down":"up");'
  2. ls storage/framework/down
  3. ./artisan isdown - usingCommands/IsDownForMaintenance.php

Check route methods

./artisan route:check - usingCommands/RouteCheckCommand.php

Check PHP version after PHP upgrade

Insert this line in the top ofbootstrap/app.php

if (phpversion() !=='8.2.7')dd('Different PHP version:',phpversion());

Check all four entry points!

Debugging

https://github.com/spatie/ray

Add the following toapp/Providers/AppServiceProvider.php

useIlluminate\Support\Facades\DB;useIlluminate\Support\Facades\Log;publicfunctionboot():void    {DB::listen(staticfunction ($query) {            Log::info('SQL query', [$query->sql,$query->bindings,$query->time]);        });    }

URL categories

  • Root files - stored inpublic/ andpublic/.well-known/ directories
  • Static assets - stored in various subdirectories ofpublic/
  • User generated media - stored instorage/app/public/ directory
  • Virtual URL-s are handled by Laravel started inpublic/index.php
  • Explicit API calls prefixed with/api/ in URL path

Nova

Custom exception handlinghttps://nova.laravel.com/docs/4.0/installation.html#error-reporting

About

Running Laraval framework-based web applications for long years 🪘

Topics

Resources

Stars

Watchers

Forks

Sponsor this project

 

[8]ページ先頭

©2009-2025 Movatter.jp