Express.js? ?? ??? ????? ???? ? ?? ??? ????. 2. ????? ?? ??? ???? ??? Express.router ()? ???? ?? ?? ??? ??? ????? ??????. 3. ????? ?????? ??? ???? ???? ???? ??? ??? ??? ???? ??? ??? ?????. ? ? ?? ??? ?? ??, ?? ? ??? ?? ? ?? ??? ??? ????? ?? ? ? ??? ???? ?? ?? ? ?? ?? ?????? ?????.
Express.js ????????? ? ????? ???? ?? ?? ?? ?? ?? ??? ????? ????? ? ?? ????? ???? ??? ????. ??? ????? ??? ?????? ?? ??? ????? ??? ???? ????.
1. ?? ??? ????? ??????
??? ?? ??? ?????. ??? ?? ? ? ?? ??? ???? ??? ?? ??? ?? ??? ? ????.
app.get ( '/profile', middlewarefunction, (req, res) => { Res.Send ( '??? ???'); });
?? :
-
middlewareFunction
? ?? ??, ?? ?? ?? ??? ?? ? ???????. - ? ??? ???? ?? ????? ?????.
- ?? ????? ???? ???? ??? ? ????.
?? ??:
?? ensueAuthenticated (req, res, next) { if (req.user) { ?? ?? (); } res.status (401) .send ( '?? ???????'); } app.get ( '/dashboard', ensureAuthenticated, (req, res) => { Res.Send ( '?? ??? ?? ?? ?????'); });
? ??? ??? ?? ? ???? ? ?????.
2. ?? ??? ?? ????? ?? ?? ???? (??? ??)
?? ?? ??? ??? ????? ???? ????? express.Router()
???? ?? ?? ??? ??? ?? ??? ????? ?? ? ? ????.
const router = express.router (); router.use (MiddlewareFunction); router.get ( '/settings', (req, res) => { Res.Send ( '??? ?? ???'); }); router.get ( '/edit', (req, res) => { Res.Send ( '??? ?? ??'); }); app.use ( '/user', router);
?? :
-
/user/settings
?/user/edit
middlewareFunction
?? ???? ?????. - ? ???
/admin/*
,/api/v1/*
?? ?? ? ??? ??? ???? ? ?? ?????.
? :
- ?? ??? ??? ?? ??? ??? ???? ?? ??? ?? ? ? ????.
- ?? ????? ??? ?? ? ? ????.
router.use (???? 1, ???? 2);
3. ??? ?? ?? ????? ????? ??? ???? ?????.
??? ?? ?? ?? ?? ??? ?? ????? ???? ??? ??? ?? ????. ?? ???? ???? ?? ? ? ????.
?? ??? Middleware (req, res, next) { if (req.path === '/special') { // ??? ??? ()? ?? ????? ?????. } ??(); }
?? express.Router()
???? ???? ?? :
const router = express.router (); router.use ((req, res, next) => { if (req.query.auth === 'true') { AuthenticateUser (Req, Res, Next); } ? ?? { ??(); } });
? ???? "???"????? ??? ?? ????? ?????.
????? ?? ??
????? :
- ?? ?? ??? ???? :
.get/.post
? ?? ??????. - ?? ??? ???? :
express.Router()
??? ?? ??? ?????. - ????? ????? ??? ???? ?????? : ???? ??? ??? ??? ??????.
??? ??? ?? ????? ???? ????? ??? ???? ?? ?? ???? ?? ??? ?? ?? ?????. ???? ????????.
? ??? ?? ?? ?? ?? ??? ????? ????? ???????? ?? ?????. ??? ??? 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)

TOWORKEFCITIVE WITHPIVOTTBLESINLARAVEL, FIRDSCESSPIVOTDATAUSINGWITHPIVOT () ORWITHTIMESTAMPS (), thenupdateentrieswithupdatee XistingPivot (), ManagerElationshipsviadetach () andsync (), andusecustompivotmodelswheneded.1.usewithpivot () toincludescificcol

Laravel ?? ???? 4 ?? ?? ??? ?? ?? ???? ???? ???? ? ????. 1. ?? ????? ???? ?? ??? ??? ??? ?? ???? ??? ???? ?????? ??? ??? ????? ?? ??? ?? ???? ??? ??????. 2. ???? ?? ????? ??????? ?????, n 1 ??? ???, ?? ??? ????, ??? ??, ??? ?? ? ?? ? ?? ??, ?? ??? ????. 3. ?? ?? ?? ? ?? ???? ??? ??? ?? ?? ??? ? ??? ???? ???? ???? ???? ???? ? ?? ????? ??????. 4. ??? ?? ? ???? ??? ??? ??? ?? ???? ????? ?? ?????? ????? ?? ???? ? ??? ?? ??? ????? ??????.

Laravel ????? ?????? ??? ???? ???? RefreshDatabase ??, ??? ??? ??, ?? ??? ?? ? ??? ?? ?? ??? ?????. 1. ?? ??? ???? ? ???? ??? ??????? ??????? ???? ?? ?????? ??? ???? ?????????. 2. ?? ??? ???? ??? ???? ??? ?? ???? ?? ?? ???? ?????. 3. DatabasEtransactionStrait? ???? ??? ?? ??? ????? ? ?????????. 4. ???? ???? ???? ??????? ???? ??? ? ?? ? ??????? ?? ??????. ??? ??? ???? ???? ???? ???? ?? ??? ? ??? ??? ?? ???? ?????.

Laravelsanctum? SPA ?? ??? ??????? ?? ???? ?? API ??? ??? ?? ??? ?? OAUTH2 ??? ??? ????? ?????. 1. Sanctum? ?? ?? ??? ????, ??? ???? ?????. 2. Passport? ?? ?? ? ????? ?? ??? ?? ??? ????? ????, ?? ???? ?????? ?????. 3. ?? ?? ? ??? ? ???? ?? ?? ??? ????. 4. ?? ??? ?????? ??? ???? ??? ?? ??? ??? ???? ?????. ??? ? ???? ?? ??? ?? OAUTH2 ??? ???? ??? ???????.

Laravel? ?? ???? ?????? ???? ??? ??????. 1. DB :: Transaction () ???? ???? ??? ???? ???? ?? ?? ?? ?? ?? ??; 2. ?? ? ????? ???? ?? ???? ?? ????? ????? ?? ???? ??? ???? ???? ??? ?? ????. 3.?? ??? ??? ??? ????? ??? begintransaction (), commit () ? rollback ()? ?? ?? ?? ??? ?????. 4. ?? ???? ??? ?? ????, ??? ?? ??, ??? ?? ? ?? ?? ??? ?????. ????? ?? ?? ??? ???? ?? ???? ??? ? ??? ???? ? ????.

Laravel?? ??? ??? ??? ???? ?? ???? ??? Route () ??? ??? ???? ????. Route () ??? ??? ?? ??? ???? ??? ???? ???? ?? ?? ???? ???? ????. 1. Route ( 'user.profile', [ 'id'=> 1])? ?? ???? ????? ?? ??? ?? ??? ?????. 2. ?? ?? ?? ? ? ?? ? ?????? ??? Route ( 'user.post.show', [ 'id'=> 1, 'postId'=> 10]? ?? ??? ??? ??? ????. 3. ??? ????? ?? ???? ???? ?? ?? ? ? ????. 4. ??? ?? ??? ???? ??? Route ( 'user.post',

Laravel?? HTTP ?? ? ??? ???? ??? ?? ???, ?? ?? ? ?? ???? ??? ????? ????. 1. ?? ???? ?? ? ? ?? ????? ?? ?? ????? ???? input () ?? ?? ???? ???? ??? ?? ??? ?? validate () ?? ?? ?? ???? ?? ? ? ????. 2. Return Response? ???,??, JSON, ?? ?? ? ??? ?? ?? ? ???? ??? ?????. 3. ?? ???? ?? ? ?? ?? () ??? ? Store ()? ???? ??? ???????. ????? ?? ?? ?? ? ??? ?????? ???? ??? ??????? ??? ? ????.

Laravel? ??? ?? ??? ?? ???? ?? ?????. ?? ??? ??? ????. 1. ?? ???? ?? ?? ?????. 2. Phpartisanqueue? ?? ???? ??? ? ? ?? ??? ?????? : Work- Queue = High, Default; 3. onqueue () ???? ???? ??? ?? ? ? ? ??? ??????. 4. Laravelhorizon ? ?? ??? ???? ??? ??? ?????? ?????. ?? ?? ?? ?? ?? ? ??? ???? ????? ?? ??? ?? ??? ?? ?????.
