Laravel ?? ? ?? ??: ?????? ??? ??? ? ?? ??
Aug 26, 2023 am 10:31 AMLaravel ?? ? ?? ??: ?????? ??? ? ?? ?? ???
??:
??? ??????? ???? ?? ??? ? ??? ??? ??? ?? ?????. ??? ???? ?????? ???? ????? ?? Laravel? ??? ?? ? ?? ?? ????? ?????. ? ????? Laravel? ?? ? ?? ?? ??? ???? ??????? ??? ? ?? ??? ????? ??? ?????.
1. ?? ??
Laravel? ??? ??? ???? ?? ?? ??? ExceptionHandler? ?????. ???????? ??? ???? ExceptionHandler? ?? ??? ???? ??? ?? ??? ?????. ?? ?? ??? ??? ???? ?? app/Exceptions/Handler.php ??? ??? ? ????.
??, ?? ????? ????? ????? ?? ??? ??? ? ????. ?? ?? ?? ??? ??? ????? ??? ????? Log::error ???? ???? ???.
public function report(Exception $exception) { if ($this->shouldReport($exception)) { Log::error($exception); } parent::report($exception); }
??? ????? ?? ??? ??? ??? ??? ?? ????. ?? ?? ??? ?? ??? ?? ??? ?? ???? ??? ? ????. ?? ?? ??? ????:
public function render($request, Exception $exception) { if ($exception instanceof NotFoundHttpException) { return response()->view('errors.404', [], 404); } return parent::render($request, $exception); }
2. ?? ??
Laravel? ??????? ?? ??? ??, ?????? ?? ?? ???? ?? ??? ??? ? ?? ??? ?? ?? ??? ?????. ?? ??? ?? ??? ?? ??????? ??? ???? ? ??? ???.
Laravel? ????? Monolog ?????? ???? ??? ?????. config/logging.php ??? ???? ?? ????? ?? ??? ??? ? ????. ??? ?? ?????.
return [ 'default' => env('LOG_CHANNEL', 'stack'), 'channels' => [ 'stack' => [ 'driver' => 'stack', 'channels' => ['daily', 'slack'], ], 'daily' => [ 'driver' => 'daily', 'path' => storage_path('logs/laravel.log'), 'level' => 'debug', 'days' => 7, ], 'slack' => [ 'driver' => 'slack', 'url' => env('LOG_SLACK_WEBHOOK_URL'), 'username' => 'Laravel Log', 'emoji' => ':boom:', 'level' => 'critical', ], ], ];
? ????? Daily ? Slack ?? 2?? ??????. ?? ??? ?????? ??? ??? ????, Slack ??? Slack ??? ?? ??? Slack ??? ??? ?????.
???? Log ???? ???? ?? ??? ??? ? ????. ?? ?? ???, ??, ??, ??, ?? ? ?? ??? ???? ??? ??? ?? ??? ??? ? ????:
use IlluminateSupportFacadesLog; Log::info('This is an informational message.'); Log::warning('This is a warning message.'); Log::error('This is an error message.');
3. ?? ??
?? ?? ? ?? ?? ??? Laravel? ??? ?? ????? ?????. ???. ???????? ?? ??? ???? ???? ??? ???? ???? ??? ???? ?? ?? ???? ??? ? ????.
?? ?? ???? ???? ??? ?? ? ????. ?? ?? ????? ????? ???? ?? ?? InvalidArgumentException? ???? ??? ????? ?? ???? ??? ? ????.
use InvalidArgumentException; if (empty($username)) { throw new InvalidArgumentException('The username cannot be empty.'); }
???? ??? ???? ? try-catch ?? ???? ?? ???? ??? ? ????. ??. ?? ??, ?? ????? InvalidArgumentException ??? ???? ?? ???? ??? ? ????:
try { // Do something... if (empty($username)) { throw new InvalidArgumentException('The username cannot be empty.'); } // Do something else... } catch (InvalidArgumentException $e) { echo $e->getMessage(); }
??:
Laravel? ?? ?? ? ?? ??? ???? ??????? ? ????? ????? ??? ??? ? ????. ?? ?? ????? ???? ??? ?? ?? ?? ??? ??? ??? ? ???, ?? ?? ????? ???? ??????? ?? ??? ???? ??? ???? ? ??? ? ? ????. ??? ??? ???? ???? ?? ???? ???? ??? ???? ?? ?? ??? ??? ? ????. ??? ???? ?? ? ?? ?? ??? ????? ???? ??????? ???? ?? ???? ?? ???? ? ????.
? ??? Laravel ?? ? ?? ??: ?????? ??? ??? ? ?? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

Laravel? ?? ??? ?? ?? ??? ?? ?? ??? ???? ??? ??????. ?? ???? ?? ??? ????? ? ???? I/O ?? ? ?? ?? ??? ???? ???? ??? ?? ? ????. 1. ?? ????? ?? ? ? ???????? ??? ????? ?? ???? ??????. 2. ??? ? ??? ?? ? ? PhPartisAnconfig? ?? ???????. 3. ?? ??? ??? ??? ???? ?? ?? ?? ???? ???? ????. 4. ?? ?? ??? ???? ?? ??? ??? .env ??? ???? ?? ???????.

PHP ????? ?? ??? ??? ? ??? ??? CI (Continuous Integration) ????? ???? ? ????. 1. DockerFile? ???? ?? ???, ?? ??, ??? ?? ? ?? ??? ???? PHP ??? ?????. 2. Gitlabci? ?? CI/CD ??? ???? .gitlab-ci.yml ??? ?? ??, ??? ? ?? ??? ???? ?? ??, ??? ? ??? ?????. 3. PHPUNIT? ?? ??? ??? ??? ???? ?? ?? ? ???? ???? ????????. 4. Kubernetes? ?? ?? ?? ??? ???? ?? .yaml ??? ?? ?? ??? ?????. 5. Dockerfile ??? ? ??? ??? ??????

Laravel? eloquentscopes? ?? ??? ??? ??? ?????? ?? ?? ??? ????? ?????. 1. ?? ??? ???? ???? ???? ???? Post :: published (); 2. ??? ??? ?? ??? ???? ???? ?? ??? ?? ?? ?? ??? ???? ???? ??? ?????? ??? ???? ???????. 3. ????? ?? ?? ?? ??? ??? ?? ?? ??? ?? ? ? ??? ?? ? ? ?? ?? ??? ?????. 4. ?? ??? ? ??? ?? ???? ? ??? ? ?? ??, ?? ??, ?? ???? ? ?? ?????????.

CreateAhelpers.phpfileInapp/helperswithCustOmFunctionsikeFormatPrice, isactiveroute, andisAdmin.2.addTheFileTothe "??"sectionOfcomposer.jsonUnderAutoLoad.3.runcomposerDump-AUTOLOADTOMAKETHINGTICTIONSGLOBELYAVAILABLE.4.USETHEHELPERFUNCUNTION

?? ?? ?? : ?? ????? PHP? ?? Error_Log ()? ??? ? ????. ????? ???? ??? ?? ??? ?????? ???? ?? ??? ? ?? ??? ???? ??? ?? ???, ??, ?? ? ?? ? ?? ?? ??? ???? ??? ??????. 2. ??? ?? ?? : ??? ??? ??? ??? ? ??? ?? ??? ??? ?? ??? ??? ??????? ??????. MySQL/PostgreSQL? ???? ??? ? ???? ??????. Elasticsearch Kibana? ? ???/? ???? ?????. ???, ??? ?? ? ??? ? ?? ??? ?? ??????. 3. ?? ? ?? ????? : ??, ???, ?? ? ??? ??? ??????. Kibana? ?? ????? PHP ??? ?? ?? ?????? ???? ???? ?????? ???? ??? ? ?? ??? ??? ? ????.

??, ??, ?? ?? ? ?? ??? ???? ?? ??? ?? ? ?? ???? ?????. 2. ?? ???? ???? ?? ??? ??? SONGSTOMONY ? HASMANY ?? ??; 3. ?? ? ? ?? ? ?? ??? ????? (?? ???? ?? ??? ? ??). 4. ?? ? ?? ??? ???? ?? ??? ???? ?? ? ?? ??? ???? ?? ??? ?????. 5. ?? ???? ??? ?? (?? ??)? ???? ?? ????? ??????. 6. ?? ??? ?? ??? ???? Laravel Signature URL? ???? ??? ??????. 7. ? ?? ?? ? ? ?? ??? ?? ?? ??? ?? ??? ?????. ?????? ??, ?? ?? ??? ??????????.

USEMOCKERYFORCUSTOMDENCENTICESBYSETEXPINTIONSWITHSHOULDRECEIVE ()

Checkphp> = 8.1, Composer, andwebserver; 2. CloneorcreateProjectandruncomposerInstall; 3.copy.env.exampleto.envandrunphpartisankey : ??; 4. 4. SetDatabasecredentitySin.envandRunphPartisanMigrate-Seed; 5.StartServerWithPhPartisAnserve; 6.OptionalLyRunnpmins
