Tymon/JWT-Auth ???? ??????. 2. JWT ?? ?? ??; 3. JWT ?? ???? .env? ?????. 4. ??? ??? jwtsubject ?????? ?????. 5. ?? ??? JWT ??? ??????. 6. ???, ?? ??, ?? ?? ? ??? ??? ???? ????? ????. 7. API.PHP?? ??? ???? ??? ?????? : API ????; 8. ??? ?? ?? ? ??? ?????? : Bearer
Laravel?? JWT (JSON Web Token) ??? ???? ?? SANTELESS API? ?????? ???? ?? ?????. ??? ???? tymon/jwt-auth
???? ???? ??? ??? ??????.

1. JWT ???? ??????
?? ???? ?? tymon/jwt-auth
???? ??????.
???? Tymon/JWT-Auth? ?????
?? : Laravel 10/9? ?? ?? ??? ??? ???? ??? ??????. ?? ????
^2.1
??????.
2. ?? ??? ??????
Artisan? ???? JWT ?? ??? ??????.
PHP Artisan ?? ?? : ?? -provider = "Tymon \ jwtauth \ Providers \ LaravelserviceProvider"
????? ?? ?? (TTL, ???? ?)? ??? ?? ? ??? config/jwt.php
??? ?????.

3. ?? ?? ??????
?? ????? ?? ?? ??????.
PHP Artisan JWT : ??
? ??? .env
??? JWT_SECRET
??? ????? - ??? ?????? ?????.
.env
? ? :
jwt_secret = your_generated_secret_key_here
4. ??? ??? ?????
User
?? (????? App\Models\User
)? JWTSubject
??? ??????.
<? php ?? ???? ? \ ??; Illuminate \ Foundation \ auth \ user? authenticatable? ??????. tymon \ jwtauth \ contracts \ jwtsubject; ??? ???? authenticatable emplements jwtsubject? ????? { // ... /** * JWT? ?? ??? ?? ? ???? ?????. */ ?? ?? getjwtidentifier () { return $ this-> getkey (); } /** * JWT? ???? ??? ?? ???? ?? ? ? ? ??? ?????. */ ?? ?? getJwtCustomClaims () { ?? []; } }
5. ?? ??? ??????
JWT ??? ????? config/auth.php
????????.
'??'=> [ '?'=> [ '????'=> '??', '???'=> '???', ],, 'API'=> [ '????'=> 'jwt', // API? JWT ????? ????? '???'=> '???', ],, ],,
?? api
??? api
??? ????? ?????? (??? ?? Laravel?? ??????).
6. ?? ????? ????
???, ?? ??, ?? ?? ? ??? ?? ??? ?? ? ????? ??????.
PHP Artisan Make : ???? ? Authcontroller
??? ?? ??? ??
?? ???? ? \ http \ ????; App \ Models \ User? ?????. Illuminate \ http \ request? ??????. Illuminate \ support \ Facades \ Hash? ??????. tymon \ jwtauth \ ??? ?????? \ jwteexception; jwtauth? ??????. ??? AuthController? ????? ????? { ?? ?? ??? (?? $ ??) { $ credentials = $ request-> ? ( '???', '????'); ???? { if (! $ token = jwtauth :: ?? ($ credentials)) { return response ()-> json ([ 'error'=> 'invalid credentials'], 401); } } catch (jwtexception $ e) { return response ()-> json ([ 'error'=> '? ??? ?? ? ??', 500); } return response ()-> json (compact ( 'Token')); } ?? ?? getAuthenticatedUser () { ???? { if (! $ user = jwtauth :: parsetoken ()-> authenticate ()) { return response ()-> json ([ 'user_not_found'], 404); } } catch (jwtexception $ e) { return response ()-> json ([ 'error'=> $ e-> getMessage ()], $ e-> getStatuscode ()); } return response ()-> json (compact ( 'user')); } ?? ?? ?? ?? () { jwtauth :: invalidate (jwtauth :: getToken ()); return response ()-> json ([ 'message'=> '????? ?? ??']); } ?? ?? ?? ?? () { $ token = jwtauth :: refresh (); return response ()-> json ([ 'token'=> $ token]); } }
7. API ??? ??????
routes/api.php
:
App \ http \ Controllers \ AuthController? ??????. route :: post ( 'login', [authcontroller :: class, 'login']); Route :: Middleware ( 'Auth : Api')-> group (function () { route :: get ( 'me', [authcontroller :: class, 'getauthenticatedUser']); route :: post ( 'logout', [authcontroller :: class, 'logout']); route :: post ( 'Refresh', [authcontroller :: class, 'refresh']); });
?? ?? ? ???? Authorization
??? ??? JWT? ?????.
?? : Bearer <Your-Token-Here>
8. ??? ???????
- ??? :
email
?password
? Post/api/login
→ Get Token. - ??? ???? : ?? ??? ??
/api/me
Authorization: Bearer <token>
→ get ???. - ?? ?? ?? : Post
/api/refresh
→ ? ??? ????. - ?? ?? : Post
/api/logout
→ ?? ??? ??????.
?? ?? : ?? ??? ??? ?????
config/jwt.php
?? :
'ttl'=> 60, // ?? 60 ? ?? ????? 'refresh_ttl'=> 20160, // 14 ? ??? ?? ?? ? ????
?? ? ?? ?
- ???? ?? HTTP? ??????.
- ?? (? :
HttpOnly
?? ?? ??? ??)? ??? ??? ??????. - ??? ???? ?? ??? ???? ??? ?? ?????.
- ?? ?? ??? ??? ??????.
????? ?? ??. tymon/jwt-auth
? ?? Laravel? JWT Auth? ?? ??? ???? ?????. JWT_SECRET
? ???? ???? ??? ???? ??????.
? ??? Laravel?? JWT ??? ???? ??? ??????? ?? ?????. ??? ??? 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?? ??? ?? ?? ??? ???? ? ?? ??? ???? : ??, ?? ??? ? ?? ??? ?????. 1. ??? ?? "admin"? ???? ?? ??? ??? ???? ?? ???? ??????. 2. ??? ??? ???? ?? ?? ? ? ????? ?? ??? (? : validusernamerule)? ????. 3. ?? ??? ?? ??? ???? ?? ?? ???? ?? ?????. ???, ??? ?? ??? ??? ?? ???? ?? ??? ??? ?? ????? ???? ???? ?? ??? ???? ? ????.

??? ??? ?????? Laravel ??????? ?? ???? ?? ?? ??, ?? ?? ???, ?? URL ??? ? ???? ????? ?? ? ??? ?????. ??, /resources /lang ????? ?? ?? (? : en, es, fr)?? ? ??? ???? ???? ?? ??? ???? ?? ??? ?????. 2. \ _ \ _ () ??? ?? ??? ?? ? ?? ???? app :: setlocale ()? ???? ?? ?? ??? ?? ??? ???? ?? ??? ?????. 3. ?? URL? ?? ??? ??? ??? ?? ?? ??? ?? ??? ????? ?? ??? ?? ??? ???? ?? ? ? ????. 4. ?? ?? ???? ??????

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

LaravelProvideAcleanAnandflexiblewaytosendNotificationsViamultipleChannels LikeEmail, SMS, In-Appalerts ? PushNotifications.youdeFinenotificationChannelsinThevia () MethodofanotificationClass, and ortovonage (), Ortovonage ()

ServiceProvider? ??? ?? ? ??? ??? ?? Laravel ??? ??? ???? ?? ???????. Artisan Command? ?? ??? ?? ServiceProvider? ?? ? ????. 1. ???? ??? ???, ???? ?? ?, ?? ?? ? ? ?????? ?? ?? ???? ???? ? ?????. 2. ?? ??? ?? ???? ?? ? ? ???? ??? ???, ???????, ???? ? ?? ???? ???? ?? ??? ???? ? ?????. ???? ???? ??? ????? ? ??, ?? ??, ????, ?? ? ?? ?? ? ? ?? ??? ?????. ServiceProvider? ?? ???? ?? ????? ???? ?????? ???? ?? ????.

??? ??? ?? ? ???? Laravel? ??? ????? ?? ??? ???? ???? ?????. ??? ????? ?? ????? ???? ???? ?? ?? ??? ?? ? ??? ?????. Laravel? ?? ????? ?? ???? ?? ???? ??? ??? ?? ??? ?????. ??? ????? ? ??? ??? ?? ??? BIND ??? ????? ?? ?? ???? ?? ?? ????? ? ??? ? ????. ?? ??? ?? ?? ????? ????, ??? ???? ???,???? ???? ???? ????, ?? ?? ?? ??? ???????. ?? ????? ?? ??? ? ?? ??? ?? ? ? ????.

Laravel ???????? ?? ? ?? ??? ???? ?? ???? ??? ?????. 1. 1. ? \ ?? \ handler ???? ???? ???? ???? ?? ??? ???? ????, ?? ?? ???? ?? report () ???? ?? ?? ??? ????? ????. 2. monolog? ???? ?? ???? ???? Config/Logging.php?? ?? ?? ? ?? ???? ???? ???? ???? ?? ??? ?? ??? ???????. ???, ??? ?? ??? ????? ?? report ()? ???? ?? ? ? ????. 3. Render () ???? ??? ???? Unified JSON ?? ?? ??? ???? API? ?? ? ??? ?? ??? ??????. ? ??? ??? ????

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