Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as:
- Simple, fast routing engine.
- Powerful dependency injection container.
- Multiple back-ends for session and cache storage.
- Expressive, intuitive database ORM.
- Database agnostic schema migrations.
- Robust background job processing.
- Real-time event broadcasting.
Laravel is accessible, yet powerful, providing tools needed for large, robust applications.
Laravel has the most extensive and thorough documentation and video tutorial library of any modern web application framework, making it a breeze to get started learning the framework.
If you're not in the mood to read, Laracasts contains over 1100 video tutorials on a range of topics including Laravel, modern PHP, unit testing, JavaScript, and more. Boost the skill level of yourself and your entire team by digging into our comprehensive video library.
We would like to extend our thanks to the following sponsors for helping fund on-going Laravel development. If you are interested in becoming a sponsor, please visit the Laravel Patreon page:
- Vehikl
- Tighten Co.
- British Software Development
- Fragrantica
- SOFTonSOFA
- User10
- Soumettre.fr
- CodeBrisk
- 1Forge
- TECPRESSO
- Pulse Storm
- Runtime Converter
- WebL'Agence
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the Laravel documentation.
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via taylor@laravel.com. All security vulnerabilities will be promptly addressed.
The Laravel framework is open-sourced software licensed under the MIT license.
curl -X POST "http://business-card.local/oauth/token" -H "accept: application/json" -H "Content-Type: multipart/form-data" -H "X-CSRF-TOKEN: " -d {"grant_type":"custom_code","client_id":"2","client_secret":"FdN8vcgfTsVy6lfvBEQplawBjwLWorzyUTTB9BbW","username":"dd","password":"","auth_type":"","code":"wx_code","refresh_token":""}
curl -X GET
http://business-card.local/api/demo/index2
-H 'Accept: application/json'
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImEwYTYzNTE3NjgwN2ZjM2Y2MjAxN2NhYjg3NjQ5MWMwODE0OTM1ZmFlNmM0NWJhYWM1ZGI0MmNkMTY0OTRkYjFhYWFjODNjNTQxODQ5MjY5In0.eyJhdW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token: 336a5180-e819-4947-8e21-0e9a270f0975'
-H 'cache-control: no-cache'
-H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW'
-F accounts_name=whm111
-F accounts_pass=6e3133357971755135507549546f7269444f38395275446a6d776b683855734b47786c33714c4852596f3833706f6374322b4b5155414c6938546e596f72464c45726557534c6d6234637372485532626c2f3871614c336c785963547352544569456575584b324f473952326f544c5a372f45323741796a657066304f46636577317051576a32686a30595272366a4d786b4961687574384a3842522f4357733952494c462f4a6d4250413d
请看 app/OAuth2/Grants/WxCode 目录
<?php
$identifier = \auth()->id();// 获取登录id
$user = auth()->user();// 用户登录用户信息
$userClass = get_class($user);// 获取登录用户class
$accountId = $user->getLoginUser()->getAccountId();// 获取登录用户账户id
$data = [
'$identifier' => $identifier,// login_user_zhaowei7900818574d95a2996bf63784e579d586f99b549
'$user' => $user, // App\OAuth2\Users\CustomAuthUser 实例
'$userClass' => $userClass, // App\OAuth2\Users\CustomAuthUser
'$accountId' => $accountId, // accountId
];
var_dump($data);
/*
array(4) {
["$identifier"]=>
string(58) "login_user_zhaowei7900818574d95a2996bf63784e579d586f99b549"
["$user"]=>
object(App\OAuth2\Users\CustomAuthUser)#585 (6) {
["identityName":protected]=>
string(2) "id"
["password":protected]=>
string(0) ""
["rememberToken":protected]=>
string(0) ""
["rememberTokenName":protected]=>
string(0) ""
["loginUser":protected]=>
object(App\OAuth2\Users\LoginUser)#584 (5) {
["data":"App\OAuth2\Users\LoginUser":private]=>
array(0) {
}
["grantType":protected]=>
string(7) "wx_code"
["accountId":protected]=>
string(7) "zhaowei"
["accountType":protected]=>
string(7) "default"
["params":protected]=>
array(0) {
}
}
["id"]=>
string(58) "login_user_zhaowei7900818574d95a2996bf63784e579d586f99b549"
}
["$userClass"]=>
string(31) "App\OAuth2\Users\CustomAuthUser"
["$accountId"]=>
string(7) "zhaowei"
}
*/