99 |
100 |
101 |
--------------------------------------------------------------------------------
/config/cache.php:
--------------------------------------------------------------------------------
1 | env('CACHE_DRIVER', 'file'),
22 |
23 | /*
24 | |--------------------------------------------------------------------------
25 | | Cache Stores
26 | |--------------------------------------------------------------------------
27 | |
28 | | Here you may define all of the cache "stores" for your application as
29 | | well as their drivers. You may even define multiple stores for the
30 | | same cache driver to group types of items stored in your caches.
31 | |
32 | */
33 |
34 | 'stores' => [
35 |
36 | 'apc' => [
37 | 'driver' => 'apc',
38 | ],
39 |
40 | 'array' => [
41 | 'driver' => 'array',
42 | ],
43 |
44 | 'database' => [
45 | 'driver' => 'database',
46 | 'table' => 'cache',
47 | 'connection' => null,
48 | ],
49 |
50 | 'file' => [
51 | 'driver' => 'file',
52 | 'path' => storage_path('framework/cache/data'),
53 | ],
54 |
55 | 'memcached' => [
56 | 'driver' => 'memcached',
57 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
58 | 'sasl' => [
59 | env('MEMCACHED_USERNAME'),
60 | env('MEMCACHED_PASSWORD'),
61 | ],
62 | 'options' => [
63 | // Memcached::OPT_CONNECT_TIMEOUT => 2000,
64 | ],
65 | 'servers' => [
66 | [
67 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'),
68 | 'port' => env('MEMCACHED_PORT', 11211),
69 | 'weight' => 100,
70 | ],
71 | ],
72 | ],
73 |
74 | 'redis' => [
75 | 'driver' => 'redis',
76 | 'connection' => 'cache',
77 | ],
78 |
79 | 'dynamodb' => [
80 | 'driver' => 'dynamodb',
81 | 'key' => env('AWS_ACCESS_KEY_ID'),
82 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
83 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
84 | 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
85 | 'endpoint' => env('DYNAMODB_ENDPOINT'),
86 | ],
87 |
88 | ],
89 |
90 | /*
91 | |--------------------------------------------------------------------------
92 | | Cache Key Prefix
93 | |--------------------------------------------------------------------------
94 | |
95 | | When utilizing a RAM based store such as APC or Memcached, there might
96 | | be other applications utilizing the same cache. So, we'll specify a
97 | | value to get prefixed to all our keys so we can avoid collisions.
98 | |
99 | */
100 |
101 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_cache'),
102 |
103 | ];
104 |
--------------------------------------------------------------------------------
/public/avatars/9.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
74 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Api/EggsController.php:
--------------------------------------------------------------------------------
1 | response->item(new \stdClass(), new UnionTransformer());
40 | }
41 |
42 | /**
43 | * @param \App\Http\Requests\Api\Eggs\StoreRequest $request
44 | *
45 | * @return \Dingo\Api\Http\Response
46 | */
47 | public function store(StoreRequest $request)
48 | {
49 | $data = $request->only([
50 | 'male_name',
51 | 'female_name',
52 | 'breeding_at',
53 | ]);
54 |
55 | $data['pregnancy'] = $request->get('pregnancy', 64);
56 |
57 | $data['user_id'] = Auth::id();
58 | $data['female_avatar'] = url(Arr::random($this->avatars));
59 | $data['cracked_at'] = Carbon::parse($data['breeding_at'])->addDay($data['pregnancy']+1)->toDateString();
60 |
61 | Egg::create($data);
62 |
63 | return $this->response->noContent();
64 | }
65 |
66 | /**
67 | * 兼容原有 API
68 | * @param \Illuminate\Http\Request $request
69 | * @param \App\Models\Egg $egg
70 | *
71 | * @return \Dingo\Api\Http\Response|void
72 | */
73 | public function done(Request $request, Egg $egg)
74 | {
75 | if ($egg->user_id != Auth::id()) {
76 | return $this->response->errorBadRequest('无权操作');
77 | }
78 |
79 | if ($egg->is_break) {
80 | return $this->response->noContent();
81 | }
82 |
83 | $egg->update([
84 | 'is_break' => true,
85 | 'cracked_at' => Carbon::now()->toDateString(),
86 | ]);
87 |
88 | return $this->response->noContent();
89 | }
90 |
91 | /**
92 | * @param \App\Http\Requests\Api\Eggs\CrackedRequest $request
93 | * @param \App\Models\Egg $egg
94 | *
95 | * @return \Dingo\Api\Http\Response|void
96 | */
97 | public function cracked(CrackedRequest $request, Egg $egg)
98 | {
99 | if ($egg->user_id != Auth::id()) {
100 | return $this->response->errorBadRequest('无权操作');
101 | }
102 |
103 | if ($egg->is_break) {
104 | return $this->response->noContent();
105 | }
106 |
107 | $egg->update([
108 | 'is_break' => true,
109 | 'cracked_at' => $request->get('cracked_at'),
110 | 'cat_number' => $request->get('cat_number'),
111 | ]);
112 |
113 | return $this->response->noContent();
114 | }
115 |
116 | /**
117 | * @param \Illuminate\Http\Request $request
118 | * @param \App\Models\Egg $egg
119 | *
120 | * @return \Dingo\Api\Http\Response|void
121 | * @throws \Exception
122 | */
123 | public function destroy(Request $request, Egg $egg)
124 | {
125 | if ($egg->user_id != Auth::id()) {
126 | return $this->response->errorBadRequest('无权操作');
127 | }
128 |
129 | $egg->delete();
130 |
131 | return $this->response->noContent();
132 | }
133 | }
134 |
--------------------------------------------------------------------------------
/config/auth.php:
--------------------------------------------------------------------------------
1 | [
17 | 'guard' => 'api',
18 | 'passwords' => 'users',
19 | ],
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | Authentication Guards
24 | |--------------------------------------------------------------------------
25 | |
26 | | Next, you may define every authentication guard for your application.
27 | | Of course, a great default configuration has been defined for you
28 | | here which uses session storage and the Eloquent user provider.
29 | |
30 | | All authentication drivers have a user provider. This defines how the
31 | | users are actually retrieved out of your database or other storage
32 | | mechanisms used by this application to persist your user's data.
33 | |
34 | | Supported: "session", "token"
35 | |
36 | */
37 |
38 | 'guards' => [
39 | 'web' => [
40 | 'driver' => 'session',
41 | 'provider' => 'users',
42 | ],
43 |
44 | 'api' => [
45 | 'driver' => 'jwt',
46 | 'provider' => 'users',
47 | 'hash' => false,
48 | ],
49 | ],
50 |
51 | /*
52 | |--------------------------------------------------------------------------
53 | | User Providers
54 | |--------------------------------------------------------------------------
55 | |
56 | | All authentication drivers have a user provider. This defines how the
57 | | users are actually retrieved out of your database or other storage
58 | | mechanisms used by this application to persist your user's data.
59 | |
60 | | If you have multiple user tables or models you may configure multiple
61 | | sources which represent each model / table. These sources may then
62 | | be assigned to any extra authentication guards you have defined.
63 | |
64 | | Supported: "database", "eloquent"
65 | |
66 | */
67 |
68 | 'providers' => [
69 | 'users' => [
70 | 'driver' => 'eloquent',
71 | 'model' => App\Models\User::class,
72 | ],
73 |
74 | // 'users' => [
75 | // 'driver' => 'database',
76 | // 'table' => 'users',
77 | // ],
78 | ],
79 |
80 | /*
81 | |--------------------------------------------------------------------------
82 | | Resetting Passwords
83 | |--------------------------------------------------------------------------
84 | |
85 | | You may specify multiple password reset configurations if you have more
86 | | than one user table or model in the application and you want to have
87 | | separate password reset settings based on the specific user types.
88 | |
89 | | The expire time is the number of minutes that the reset token should be
90 | | considered valid. This security feature keeps tokens short-lived so
91 | | they have less time to be guessed. You may change this as needed.
92 | |
93 | */
94 |
95 | 'passwords' => [
96 | 'users' => [
97 | 'provider' => 'users',
98 | 'table' => 'password_resets',
99 | 'expire' => 60,
100 | 'throttle' => 60,
101 | ],
102 | ],
103 |
104 | /*
105 | |--------------------------------------------------------------------------
106 | | Password Confirmation Timeout
107 | |--------------------------------------------------------------------------
108 | |
109 | | Here you may define the amount of seconds before a password confirmation
110 | | times out and the user is prompted to re-enter their password via the
111 | | confirmation screen. By default, the timeout lasts for three hours.
112 | |
113 | */
114 |
115 | 'password_timeout' => 10800,
116 |
117 | ];
118 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | ## About Laravel
11 |
12 | 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 takes the pain out of development by easing common tasks used in many web projects, such as:
13 |
14 | - [Simple, fast routing engine](https://laravel.com/docs/routing).
15 | - [Powerful dependency injection container](https://laravel.com/docs/container).
16 | - Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
17 | - Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
18 | - Database agnostic [schema migrations](https://laravel.com/docs/migrations).
19 | - [Robust background job processing](https://laravel.com/docs/queues).
20 | - [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
21 |
22 | Laravel is accessible, powerful, and provides tools required for large, robust applications.
23 |
24 | ## Learning Laravel
25 |
26 | Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
27 |
28 | If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 1500 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
29 |
30 | ## Laravel Sponsors
31 |
32 | We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](https://patreon.com/taylorotwell).
33 |
34 | - **[Vehikl](https://vehikl.com/)**
35 | - **[Tighten Co.](https://tighten.co)**
36 | - **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
37 | - **[64 Robots](https://64robots.com)**
38 | - **[Cubet Techno Labs](https://cubettech.com)**
39 | - **[Cyber-Duck](https://cyber-duck.co.uk)**
40 | - **[British Software Development](https://www.britishsoftware.co)**
41 | - **[Webdock, Fast VPS Hosting](https://www.webdock.io/en)**
42 | - **[DevSquad](https://devsquad.com)**
43 | - [UserInsights](https://userinsights.com)
44 | - [Fragrantica](https://www.fragrantica.com)
45 | - [SOFTonSOFA](https://softonsofa.com/)
46 | - [User10](https://user10.com)
47 | - [Soumettre.fr](https://soumettre.fr/)
48 | - [CodeBrisk](https://codebrisk.com)
49 | - [1Forge](https://1forge.com)
50 | - [TECPRESSO](https://tecpresso.co.jp/)
51 | - [Runtime Converter](http://runtimeconverter.com/)
52 | - [WebL'Agence](https://weblagence.com/)
53 | - [Invoice Ninja](https://www.invoiceninja.com)
54 | - [iMi digital](https://www.imi-digital.de/)
55 | - [Earthlink](https://www.earthlink.ro/)
56 | - [Steadfast Collective](https://steadfastcollective.com/)
57 | - [We Are The Robots Inc.](https://watr.mx/)
58 | - [Understand.io](https://www.understand.io/)
59 | - [Abdel Elrafa](https://abdelelrafa.com)
60 | - [Hyper Host](https://hyper.host)
61 | - [Appoly](https://www.appoly.co.uk)
62 | - [OP.GG](https://op.gg)
63 |
64 | ## Contributing
65 |
66 | Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
67 |
68 | ## Code of Conduct
69 |
70 | In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
71 |
72 | ## Security Vulnerabilities
73 |
74 | If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
75 |
76 | ## License
77 |
78 | The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
79 |
--------------------------------------------------------------------------------
/config/wechat.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * This source file is subject to the MIT license that is bundled
9 | * with this source code in the file LICENSE.
10 | */
11 |
12 | return [
13 | /*
14 | * 默认配置,将会合并到各模块中
15 | */
16 | 'defaults' => [
17 | /*
18 | * 指定 API 调用返回结果的类型:array(default)/collection/object/raw/自定义类名
19 | */
20 | 'response_type' => 'array',
21 |
22 | /*
23 | * 使用 Laravel 的缓存系统
24 | */
25 | 'use_laravel_cache' => true,
26 |
27 | /*
28 | * 日志配置
29 | *
30 | * level: 日志级别,可选为:
31 | * debug/info/notice/warning/error/critical/alert/emergency
32 | * file:日志文件位置(绝对路径!!!),要求可写权限
33 | */
34 | 'log' => [
35 | 'level' => env('WECHAT_LOG_LEVEL', 'debug'),
36 | 'file' => env('WECHAT_LOG_FILE', storage_path('logs/wechat.log')),
37 | ],
38 | ],
39 |
40 | /*
41 | * 路由配置
42 | */
43 | 'route' => [
44 | /*
45 | * 开放平台第三方平台路由配置
46 | */
47 | // 'open_platform' => [
48 | // 'uri' => 'serve',
49 | // 'action' => Overtrue\LaravelWeChat\Controllers\OpenPlatformController::class,
50 | // 'attributes' => [
51 | // 'prefix' => 'open-platform',
52 | // 'middleware' => null,
53 | // ],
54 | // ],
55 | ],
56 |
57 | /*
58 | * 公众号
59 | */
60 | 'official_account' => [
61 | 'default' => [
62 | 'app_id' => env('WECHAT_OFFICIAL_ACCOUNT_APPID', 'your-app-id'), // AppID
63 | 'secret' => env('WECHAT_OFFICIAL_ACCOUNT_SECRET', 'your-app-secret'), // AppSecret
64 | 'token' => env('WECHAT_OFFICIAL_ACCOUNT_TOKEN', 'your-token'), // Token
65 | 'aes_key' => env('WECHAT_OFFICIAL_ACCOUNT_AES_KEY', ''), // EncodingAESKey
66 |
67 | /*
68 | * OAuth 配置
69 | *
70 | * scopes:公众平台(snsapi_userinfo / snsapi_base),开放平台:snsapi_login
71 | * callback:OAuth授权完成后的回调页地址(如果使用中间件,则随便填写。。。)
72 | */
73 | // 'oauth' => [
74 | // 'scopes' => array_map('trim', explode(',', env('WECHAT_OFFICIAL_ACCOUNT_OAUTH_SCOPES', 'snsapi_userinfo'))),
75 | // 'callback' => env('WECHAT_OFFICIAL_ACCOUNT_OAUTH_CALLBACK', '/examples/oauth_callback.php'),
76 | // ],
77 | ],
78 | ],
79 |
80 | /*
81 | * 开放平台第三方平台
82 | */
83 | // 'open_platform' => [
84 | // 'default' => [
85 | // 'app_id' => env('WECHAT_OPEN_PLATFORM_APPID', ''),
86 | // 'secret' => env('WECHAT_OPEN_PLATFORM_SECRET', ''),
87 | // 'token' => env('WECHAT_OPEN_PLATFORM_TOKEN', ''),
88 | // 'aes_key' => env('WECHAT_OPEN_PLATFORM_AES_KEY', ''),
89 | // ],
90 | // ],
91 |
92 | /*
93 | * 小程序
94 | */
95 | 'mini_program' => [
96 | 'default' => [
97 | 'app_id' => env('WECHAT_MINI_PROGRAM_APPID', env('WECHAT_APP_ID')),
98 | 'secret' => env('WECHAT_MINI_PROGRAM_SECRET', env('WECHAT_SECRET')),
99 | 'token' => env('WECHAT_MINI_PROGRAM_TOKEN', ''),
100 | 'aes_key' => env('WECHAT_MINI_PROGRAM_AES_KEY', ''),
101 | ],
102 | ],
103 |
104 | /*
105 | * 微信支付
106 | */
107 | // 'payment' => [
108 | // 'default' => [
109 | // 'sandbox' => env('WECHAT_PAYMENT_SANDBOX', false),
110 | // 'app_id' => env('WECHAT_PAYMENT_APPID', ''),
111 | // 'mch_id' => env('WECHAT_PAYMENT_MCH_ID', 'your-mch-id'),
112 | // 'key' => env('WECHAT_PAYMENT_KEY', 'key-for-signature'),
113 | // 'cert_path' => env('WECHAT_PAYMENT_CERT_PATH', 'path/to/cert/apiclient_cert.pem'), // XXX: 绝对路径!!!!
114 | // 'key_path' => env('WECHAT_PAYMENT_KEY_PATH', 'path/to/cert/apiclient_key.pem'), // XXX: 绝对路径!!!!
115 | // 'notify_url' => 'http://example.com/payments/wechat-notify', // 默认支付结果通知地址
116 | // ],
117 | // // ...
118 | // ],
119 |
120 | /*
121 | * 企业微信
122 | */
123 | // 'work' => [
124 | // 'default' => [
125 | // 'corp_id' => 'xxxxxxxxxxxxxxxxx',
126 | // 'agent_id' => 100020,
127 | // 'secret' => env('WECHAT_WORK_AGENT_CONTACTS_SECRET', ''),
128 | // //...
129 | // ],
130 | // ],
131 | ];
132 |
--------------------------------------------------------------------------------
/config/mail.php:
--------------------------------------------------------------------------------
1 | env('MAIL_DRIVER', 'smtp'),
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | SMTP Host Address
24 | |--------------------------------------------------------------------------
25 | |
26 | | Here you may provide the host address of the SMTP server used by your
27 | | applications. A default option is provided that is compatible with
28 | | the Mailgun mail service which will provide reliable deliveries.
29 | |
30 | */
31 |
32 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
33 |
34 | /*
35 | |--------------------------------------------------------------------------
36 | | SMTP Host Port
37 | |--------------------------------------------------------------------------
38 | |
39 | | This is the SMTP port used by your application to deliver e-mails to
40 | | users of the application. Like the host we have set this value to
41 | | stay compatible with the Mailgun e-mail application by default.
42 | |
43 | */
44 |
45 | 'port' => env('MAIL_PORT', 587),
46 |
47 | /*
48 | |--------------------------------------------------------------------------
49 | | Global "From" Address
50 | |--------------------------------------------------------------------------
51 | |
52 | | You may wish for all e-mails sent by your application to be sent from
53 | | the same address. Here, you may specify a name and address that is
54 | | used globally for all e-mails that are sent by your application.
55 | |
56 | */
57 |
58 | 'from' => [
59 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
60 | 'name' => env('MAIL_FROM_NAME', 'Example'),
61 | ],
62 |
63 | /*
64 | |--------------------------------------------------------------------------
65 | | E-Mail Encryption Protocol
66 | |--------------------------------------------------------------------------
67 | |
68 | | Here you may specify the encryption protocol that should be used when
69 | | the application send e-mail messages. A sensible default using the
70 | | transport layer security protocol should provide great security.
71 | |
72 | */
73 |
74 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'),
75 |
76 | /*
77 | |--------------------------------------------------------------------------
78 | | SMTP Server Username
79 | |--------------------------------------------------------------------------
80 | |
81 | | If your SMTP server requires a username for authentication, you should
82 | | set it here. This will get used to authenticate with your server on
83 | | connection. You may also set the "password" value below this one.
84 | |
85 | */
86 |
87 | 'username' => env('MAIL_USERNAME'),
88 |
89 | 'password' => env('MAIL_PASSWORD'),
90 |
91 | /*
92 | |--------------------------------------------------------------------------
93 | | Sendmail System Path
94 | |--------------------------------------------------------------------------
95 | |
96 | | When using the "sendmail" driver to send e-mails, we will need to know
97 | | the path to where Sendmail lives on this server. A default path has
98 | | been provided here, which will work well on most of your systems.
99 | |
100 | */
101 |
102 | 'sendmail' => '/usr/sbin/sendmail -bs',
103 |
104 | /*
105 | |--------------------------------------------------------------------------
106 | | Markdown Mail Settings
107 | |--------------------------------------------------------------------------
108 | |
109 | | If you are using Markdown based email rendering, you may configure your
110 | | theme and component paths here, allowing you to customize the design
111 | | of the emails. Or, you may simply stick with the Laravel defaults!
112 | |
113 | */
114 |
115 | 'markdown' => [
116 | 'theme' => 'default',
117 |
118 | 'paths' => [
119 | resource_path('views/vendor/mail'),
120 | ],
121 | ],
122 |
123 | /*
124 | |--------------------------------------------------------------------------
125 | | Log Channel
126 | |--------------------------------------------------------------------------
127 | |
128 | | If you are using the "log" driver, you may specify the logging channel
129 | | if you prefer to keep mail messages separate from other log entries
130 | | for simpler reading. Otherwise, the default channel will be used.
131 | |
132 | */
133 |
134 | 'log_channel' => env('MAIL_LOG_CHANNEL'),
135 |
136 | ];
137 |
--------------------------------------------------------------------------------
/public/avatars/6.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/config/database.php:
--------------------------------------------------------------------------------
1 | env('DB_CONNECTION', 'mysql'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Database Connections
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here are each of the database connections setup for your application.
26 | | Of course, examples of configuring each database platform that is
27 | | supported by Laravel is shown below to make development simple.
28 | |
29 | |
30 | | All database work in Laravel is done through the PHP PDO facilities
31 | | so make sure you have the driver for your particular database of
32 | | choice installed on your machine before you begin development.
33 | |
34 | */
35 |
36 | 'connections' => [
37 |
38 | 'sqlite' => [
39 | 'driver' => 'sqlite',
40 | 'url' => env('DATABASE_URL'),
41 | 'database' => env('DB_DATABASE', database_path('database.sqlite')),
42 | 'prefix' => '',
43 | 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
44 | ],
45 |
46 | 'mysql' => [
47 | 'driver' => 'mysql',
48 | 'url' => env('DATABASE_URL'),
49 | 'host' => env('DB_HOST', '127.0.0.1'),
50 | 'port' => env('DB_PORT', '3306'),
51 | 'database' => env('DB_DATABASE', 'forge'),
52 | 'username' => env('DB_USERNAME', 'forge'),
53 | 'password' => env('DB_PASSWORD', ''),
54 | 'unix_socket' => env('DB_SOCKET', ''),
55 | 'charset' => 'utf8mb4',
56 | 'collation' => 'utf8mb4_unicode_ci',
57 | 'prefix' => '',
58 | 'prefix_indexes' => true,
59 | 'strict' => true,
60 | 'engine' => null,
61 | 'options' => extension_loaded('pdo_mysql') ? array_filter([
62 | PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
63 | ]) : [],
64 | ],
65 |
66 | 'pgsql' => [
67 | 'driver' => 'pgsql',
68 | 'url' => env('DATABASE_URL'),
69 | 'host' => env('DB_HOST', '127.0.0.1'),
70 | 'port' => env('DB_PORT', '5432'),
71 | 'database' => env('DB_DATABASE', 'forge'),
72 | 'username' => env('DB_USERNAME', 'forge'),
73 | 'password' => env('DB_PASSWORD', ''),
74 | 'charset' => 'utf8',
75 | 'prefix' => '',
76 | 'prefix_indexes' => true,
77 | 'schema' => 'public',
78 | 'sslmode' => 'prefer',
79 | ],
80 |
81 | 'sqlsrv' => [
82 | 'driver' => 'sqlsrv',
83 | 'url' => env('DATABASE_URL'),
84 | 'host' => env('DB_HOST', 'localhost'),
85 | 'port' => env('DB_PORT', '1433'),
86 | 'database' => env('DB_DATABASE', 'forge'),
87 | 'username' => env('DB_USERNAME', 'forge'),
88 | 'password' => env('DB_PASSWORD', ''),
89 | 'charset' => 'utf8',
90 | 'prefix' => '',
91 | 'prefix_indexes' => true,
92 | ],
93 |
94 | ],
95 |
96 | /*
97 | |--------------------------------------------------------------------------
98 | | Migration Repository Table
99 | |--------------------------------------------------------------------------
100 | |
101 | | This table keeps track of all the migrations that have already run for
102 | | your application. Using this information, we can determine which of
103 | | the migrations on disk haven't actually been run in the database.
104 | |
105 | */
106 |
107 | 'migrations' => 'migrations',
108 |
109 | /*
110 | |--------------------------------------------------------------------------
111 | | Redis Databases
112 | |--------------------------------------------------------------------------
113 | |
114 | | Redis is an open source, fast, and advanced key-value store that also
115 | | provides a richer body of commands than a typical key-value system
116 | | such as APC or Memcached. Laravel makes it easy to dig right in.
117 | |
118 | */
119 |
120 | 'redis' => [
121 |
122 | 'client' => env('REDIS_CLIENT', 'phpredis'),
123 |
124 | 'options' => [
125 | 'cluster' => env('REDIS_CLUSTER', 'redis'),
126 | 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'),
127 | ],
128 |
129 | 'default' => [
130 | 'url' => env('REDIS_URL'),
131 | 'host' => env('REDIS_HOST', '127.0.0.1'),
132 | 'password' => env('REDIS_PASSWORD', null),
133 | 'port' => env('REDIS_PORT', '6379'),
134 | 'database' => env('REDIS_DB', '0'),
135 | ],
136 |
137 | 'cache' => [
138 | 'url' => env('REDIS_URL'),
139 | 'host' => env('REDIS_HOST', '127.0.0.1'),
140 | 'password' => env('REDIS_PASSWORD', null),
141 | 'port' => env('REDIS_PORT', '6379'),
142 | 'database' => env('REDIS_CACHE_DB', '1'),
143 | ],
144 |
145 | ],
146 |
147 | ];
148 |
--------------------------------------------------------------------------------
/public/avatars/7.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
106 |
--------------------------------------------------------------------------------
/config/session.php:
--------------------------------------------------------------------------------
1 | env('SESSION_DRIVER', 'file'),
22 |
23 | /*
24 | |--------------------------------------------------------------------------
25 | | Session Lifetime
26 | |--------------------------------------------------------------------------
27 | |
28 | | Here you may specify the number of minutes that you wish the session
29 | | to be allowed to remain idle before it expires. If you want them
30 | | to immediately expire on the browser closing, set that option.
31 | |
32 | */
33 |
34 | 'lifetime' => env('SESSION_LIFETIME', 120),
35 |
36 | 'expire_on_close' => false,
37 |
38 | /*
39 | |--------------------------------------------------------------------------
40 | | Session Encryption
41 | |--------------------------------------------------------------------------
42 | |
43 | | This option allows you to easily specify that all of your session data
44 | | should be encrypted before it is stored. All encryption will be run
45 | | automatically by Laravel and you can use the Session like normal.
46 | |
47 | */
48 |
49 | 'encrypt' => false,
50 |
51 | /*
52 | |--------------------------------------------------------------------------
53 | | Session File Location
54 | |--------------------------------------------------------------------------
55 | |
56 | | When using the native session driver, we need a location where session
57 | | files may be stored. A default has been set for you but a different
58 | | location may be specified. This is only needed for file sessions.
59 | |
60 | */
61 |
62 | 'files' => storage_path('framework/sessions'),
63 |
64 | /*
65 | |--------------------------------------------------------------------------
66 | | Session Database Connection
67 | |--------------------------------------------------------------------------
68 | |
69 | | When using the "database" or "redis" session drivers, you may specify a
70 | | connection that should be used to manage these sessions. This should
71 | | correspond to a connection in your database configuration options.
72 | |
73 | */
74 |
75 | 'connection' => env('SESSION_CONNECTION', null),
76 |
77 | /*
78 | |--------------------------------------------------------------------------
79 | | Session Database Table
80 | |--------------------------------------------------------------------------
81 | |
82 | | When using the "database" session driver, you may specify the table we
83 | | should use to manage the sessions. Of course, a sensible default is
84 | | provided for you; however, you are free to change this as needed.
85 | |
86 | */
87 |
88 | 'table' => 'sessions',
89 |
90 | /*
91 | |--------------------------------------------------------------------------
92 | | Session Cache Store
93 | |--------------------------------------------------------------------------
94 | |
95 | | When using the "apc", "memcached", or "dynamodb" session drivers you may
96 | | list a cache store that should be used for these sessions. This value
97 | | must match with one of the application's configured cache "stores".
98 | |
99 | */
100 |
101 | 'store' => env('SESSION_STORE', null),
102 |
103 | /*
104 | |--------------------------------------------------------------------------
105 | | Session Sweeping Lottery
106 | |--------------------------------------------------------------------------
107 | |
108 | | Some session drivers must manually sweep their storage location to get
109 | | rid of old sessions from storage. Here are the chances that it will
110 | | happen on a given request. By default, the odds are 2 out of 100.
111 | |
112 | */
113 |
114 | 'lottery' => [2, 100],
115 |
116 | /*
117 | |--------------------------------------------------------------------------
118 | | Session Cookie Name
119 | |--------------------------------------------------------------------------
120 | |
121 | | Here you may change the name of the cookie used to identify a session
122 | | instance by ID. The name specified here will get used every time a
123 | | new session cookie is created by the framework for every driver.
124 | |
125 | */
126 |
127 | 'cookie' => env(
128 | 'SESSION_COOKIE',
129 | Str::slug(env('APP_NAME', 'laravel'), '_').'_session'
130 | ),
131 |
132 | /*
133 | |--------------------------------------------------------------------------
134 | | Session Cookie Path
135 | |--------------------------------------------------------------------------
136 | |
137 | | The session cookie path determines the path for which the cookie will
138 | | be regarded as available. Typically, this will be the root path of
139 | | your application but you are free to change this when necessary.
140 | |
141 | */
142 |
143 | 'path' => '/',
144 |
145 | /*
146 | |--------------------------------------------------------------------------
147 | | Session Cookie Domain
148 | |--------------------------------------------------------------------------
149 | |
150 | | Here you may change the domain of the cookie used to identify a session
151 | | in your application. This will determine which domains the cookie is
152 | | available to in your application. A sensible default has been set.
153 | |
154 | */
155 |
156 | 'domain' => env('SESSION_DOMAIN', null),
157 |
158 | /*
159 | |--------------------------------------------------------------------------
160 | | HTTPS Only Cookies
161 | |--------------------------------------------------------------------------
162 | |
163 | | By setting this option to true, session cookies will only be sent back
164 | | to the server if the browser has a HTTPS connection. This will keep
165 | | the cookie from being sent to you if it can not be done securely.
166 | |
167 | */
168 |
169 | 'secure' => env('SESSION_SECURE_COOKIE', false),
170 |
171 | /*
172 | |--------------------------------------------------------------------------
173 | | HTTP Access Only
174 | |--------------------------------------------------------------------------
175 | |
176 | | Setting this value to true will prevent JavaScript from accessing the
177 | | value of the cookie and the cookie will only be accessible through
178 | | the HTTP protocol. You are free to modify this option if needed.
179 | |
180 | */
181 |
182 | 'http_only' => true,
183 |
184 | /*
185 | |--------------------------------------------------------------------------
186 | | Same-Site Cookies
187 | |--------------------------------------------------------------------------
188 | |
189 | | This option determines how your cookies behave when cross-site requests
190 | | take place, and can be used to mitigate CSRF attacks. By default, we
191 | | do not enable this as other CSRF protection services are in place.
192 | |
193 | | Supported: "lax", "strict", "none"
194 | |
195 | */
196 |
197 | 'same_site' => null,
198 |
199 | ];
200 |
--------------------------------------------------------------------------------
/resources/lang/zh-CN/validation.php:
--------------------------------------------------------------------------------
1 | '您必须接受:attribute',
16 | 'active_url' => ':attribute不是一个有效的网址',
17 | 'after' => ':attribute必须要晚于 :date',
18 | 'after_or_equal' => ':attribute必须要等于 :date 或更晚',
19 | 'alpha' => ':attribute只能由字母组成',
20 | 'alpha_dash' => ':attribute只能由字母、数字、短划线(-)和下划线(_)组成',
21 | 'alpha_num' => ':attribute只能由字母和数字组成',
22 | 'array' => ':attribute必须是一个数组',
23 | 'before' => ':attribute必须要早于 :date',
24 | 'before_or_equal' => ':attribute必须要等于 :date 或更早',
25 | 'between' => [
26 | 'numeric' => ':attribute必须介于 :min - :max 之间',
27 | 'file' => ':attribute必须介于 :min - :max KB 之间',
28 | 'string' => ':attribute必须介于 :min - :max 个字符之间',
29 | 'array' => ':attribute必须只有 :min - :max 个单元',
30 | ],
31 | 'boolean' => ':attribute必须为布尔值',
32 | 'confirmed' => ':attribute两次输入不一致',
33 | 'date' => ':attribute不是一个有效的日期',
34 | 'date_equals' => ':attribute必须要等于 :date',
35 | 'date_format' => ':attribute的格式必须为 :format',
36 | 'different' => ':attribute和 :other 必须不同',
37 | 'digits' => ':attribute必须是 :digits 位的数字',
38 | 'digits_between' => ':attribute必须是介于 :min 和 :max 位的数字',
39 | 'dimensions' => ':attribute图片尺寸不正确',
40 | 'distinct' => ':attribute已经存在',
41 | 'email' => ':attribute不是一个合法的邮箱',
42 | 'ends_with' => ':attribute必须以 :values 为结尾',
43 | 'exists' => ':attribute不存在',
44 | 'file' => ':attribute必须是文件',
45 | 'filled' => ':attribute不能为空',
46 | 'gt' => [
47 | 'numeric' => ':attribute必须大于 :value',
48 | 'file' => ':attribute必须大于 :value KB',
49 | 'string' => ':attribute必须多于 :value 个字符',
50 | 'array' => ':attribute必须多于 :value 个元素',
51 | ],
52 | 'gte' => [
53 | 'numeric' => ':attribute必须大于或等于 :value',
54 | 'file' => ':attribute必须大于或等于 :value KB',
55 | 'string' => ':attribute必须多于或等于 :value 个字符',
56 | 'array' => ':attribute必须多于或等于 :value 个元素',
57 | ],
58 | 'image' => ':attribute必须是图片',
59 | 'in' => '已选的属性 :attribute 非法',
60 | 'in_array' => ':attribute没有在 :other 中',
61 | 'integer' => ':attribute必须是整数',
62 | 'ip' => ':attribute必须是有效的 IP 地址',
63 | 'ipv4' => ':attribute必须是有效的 IPv4 地址',
64 | 'ipv6' => ':attribute必须是有效的 IPv6 地址',
65 | 'json' => ':attribute必须是正确的 JSON 格式',
66 | 'lt' => [
67 | 'numeric' => ':attribute必须小于 :value',
68 | 'file' => ':attribute必须小于 :value KB',
69 | 'string' => ':attribute必须少于 :value 个字符',
70 | 'array' => ':attribute必须少于 :value 个元素',
71 | ],
72 | 'lte' => [
73 | 'numeric' => ':attribute必须小于或等于 :value',
74 | 'file' => ':attribute必须小于或等于 :value KB',
75 | 'string' => ':attribute必须少于或等于 :value 个字符',
76 | 'array' => ':attribute必须少于或等于 :value 个元素',
77 | ],
78 | 'max' => [
79 | 'numeric' => ':attribute不能大于:max',
80 | 'file' => ':attribute不能大于:maxKB',
81 | 'string' => ':attribute不能大于:max个字符',
82 | 'array' => ':attribute最多只有:max个单元',
83 | ],
84 | 'mimes' => ':attribute必须是一个 :values 类型的文件',
85 | 'mimetypes' => ':attribute必须是一个 :values 类型的文件',
86 | 'min' => [
87 | 'numeric' => ':attribute必须大于等于 :min',
88 | 'file' => ':attribute大小不能小于 :min KB',
89 | 'string' => ':attribute至少为 :min 个字符',
90 | 'array' => ':attribute至少有 :min 个单元',
91 | ],
92 | 'not_in' => '已选的属性 :attribute 非法',
93 | 'not_regex' => ':attribute的格式错误',
94 | 'numeric' => ':attribute必须是一个数字',
95 | 'password' => '密码错误',
96 | 'present' => ':attribute必须存在',
97 | 'regex' => ':attribute格式不正确',
98 | 'required' => ':attribute不能为空',
99 | 'required_if' => '当 :other 为 :value 时 :attribute 不能为空',
100 | 'required_unless' => '当 :other 不为 :values 时 :attribute 不能为空',
101 | 'required_with' => '当 :values 存在时 :attribute 不能为空',
102 | 'required_with_all' => '当 :values 存在时 :attribute 不能为空',
103 | 'required_without' => '当 :values 不存在时 :attribute 不能为空',
104 | 'required_without_all' => '当 :values 都不存在时 :attribute 不能为空',
105 | 'same' => ':attribute和 :other 必须相同',
106 | 'size' => [
107 | 'numeric' => ':attribute大小必须为 :size',
108 | 'file' => ':attribute大小必须为 :size KB',
109 | 'string' => ':attribute必须是 :size 个字符',
110 | 'array' => ':attribute必须为 :size 个单元',
111 | ],
112 | 'starts_with' => ':attribute必须以 :values 为开头',
113 | 'string' => ':attribute必须是一个字符串',
114 | 'timezone' => ':attribute必须是一个合法的时区值',
115 | 'unique' => ':attribute已经存在',
116 | 'uploaded' => ':attribute上传失败',
117 | 'url' => ':attribute格式不正确',
118 | 'uuid' => ':attribute必须是有效的 UUID',
119 |
120 | /*
121 | |--------------------------------------------------------------------------
122 | | Custom Validation Language Lines
123 | |--------------------------------------------------------------------------
124 | |
125 | | Here you may specify custom validation messages for attributes using the
126 | | convention "attribute.rule" to name the lines. This makes it quick to
127 | | specify a specific custom language line for a given attribute rule.
128 | |
129 | */
130 |
131 | 'custom' => [
132 | 'attribute-name' => [
133 | 'rule-name' => 'custom-message',
134 | ],
135 | ],
136 |
137 | /*
138 | |--------------------------------------------------------------------------
139 | | Custom Validation Attributes
140 | |--------------------------------------------------------------------------
141 | |
142 | | The following language lines are used to swap our attribute placeholder
143 | | with something more reader friendly such as "E-Mail Address" instead
144 | | of "email". This simply helps us make our message more expressive.
145 | |
146 | */
147 |
148 | 'attributes' => [
149 | 'name' => '名称',
150 | 'username' => '用户名',
151 | 'email' => '邮箱',
152 | 'first_name' => '名',
153 | 'last_name' => '姓',
154 | 'password' => '密码',
155 | 'password_confirmation' => '确认密码',
156 | 'city' => '城市',
157 | 'country' => '国家',
158 | 'address' => '地址',
159 | 'phone' => '电话',
160 | 'mobile' => '手机',
161 | 'age' => '年龄',
162 | 'sex' => '性别',
163 | 'gender' => '性别',
164 | 'day' => '天',
165 | 'month' => '月',
166 | 'year' => '年',
167 | 'hour' => '时',
168 | 'minute' => '分',
169 | 'second' => '秒',
170 | 'title' => '标题',
171 | 'content' => '内容',
172 | 'description' => '描述',
173 | 'excerpt' => '摘要',
174 | 'date' => '日期',
175 | 'time' => '时间',
176 | 'available' => '可用的',
177 | 'size' => '大小',
178 | ],
179 | ];
180 |
--------------------------------------------------------------------------------
/resources/lang/en/validation.php:
--------------------------------------------------------------------------------
1 | 'The :attribute must be accepted.',
17 | 'active_url' => 'The :attribute is not a valid URL.',
18 | 'after' => 'The :attribute must be a date after :date.',
19 | 'after_or_equal' => 'The :attribute must be a date after or equal to :date.',
20 | 'alpha' => 'The :attribute may only contain letters.',
21 | 'alpha_dash' => 'The :attribute may only contain letters, numbers, dashes and underscores.',
22 | 'alpha_num' => 'The :attribute may only contain letters and numbers.',
23 | 'array' => 'The :attribute must be an array.',
24 | 'before' => 'The :attribute must be a date before :date.',
25 | 'before_or_equal' => 'The :attribute must be a date before or equal to :date.',
26 | 'between' => [
27 | 'numeric' => 'The :attribute must be between :min and :max.',
28 | 'file' => 'The :attribute must be between :min and :max kilobytes.',
29 | 'string' => 'The :attribute must be between :min and :max characters.',
30 | 'array' => 'The :attribute must have between :min and :max items.',
31 | ],
32 | 'boolean' => 'The :attribute field must be true or false.',
33 | 'confirmed' => 'The :attribute confirmation does not match.',
34 | 'date' => 'The :attribute is not a valid date.',
35 | 'date_equals' => 'The :attribute must be a date equal to :date.',
36 | 'date_format' => 'The :attribute does not match the format :format.',
37 | 'different' => 'The :attribute and :other must be different.',
38 | 'digits' => 'The :attribute must be :digits digits.',
39 | 'digits_between' => 'The :attribute must be between :min and :max digits.',
40 | 'dimensions' => 'The :attribute has invalid image dimensions.',
41 | 'distinct' => 'The :attribute field has a duplicate value.',
42 | 'email' => 'The :attribute must be a valid email address.',
43 | 'ends_with' => 'The :attribute must end with one of the following: :values.',
44 | 'exists' => 'The selected :attribute is invalid.',
45 | 'file' => 'The :attribute must be a file.',
46 | 'filled' => 'The :attribute field must have a value.',
47 | 'gt' => [
48 | 'numeric' => 'The :attribute must be greater than :value.',
49 | 'file' => 'The :attribute must be greater than :value kilobytes.',
50 | 'string' => 'The :attribute must be greater than :value characters.',
51 | 'array' => 'The :attribute must have more than :value items.',
52 | ],
53 | 'gte' => [
54 | 'numeric' => 'The :attribute must be greater than or equal :value.',
55 | 'file' => 'The :attribute must be greater than or equal :value kilobytes.',
56 | 'string' => 'The :attribute must be greater than or equal :value characters.',
57 | 'array' => 'The :attribute must have :value items or more.',
58 | ],
59 | 'image' => 'The :attribute must be an image.',
60 | 'in' => 'The selected :attribute is invalid.',
61 | 'in_array' => 'The :attribute field does not exist in :other.',
62 | 'integer' => 'The :attribute must be an integer.',
63 | 'ip' => 'The :attribute must be a valid IP address.',
64 | 'ipv4' => 'The :attribute must be a valid IPv4 address.',
65 | 'ipv6' => 'The :attribute must be a valid IPv6 address.',
66 | 'json' => 'The :attribute must be a valid JSON string.',
67 | 'lt' => [
68 | 'numeric' => 'The :attribute must be less than :value.',
69 | 'file' => 'The :attribute must be less than :value kilobytes.',
70 | 'string' => 'The :attribute must be less than :value characters.',
71 | 'array' => 'The :attribute must have less than :value items.',
72 | ],
73 | 'lte' => [
74 | 'numeric' => 'The :attribute must be less than or equal :value.',
75 | 'file' => 'The :attribute must be less than or equal :value kilobytes.',
76 | 'string' => 'The :attribute must be less than or equal :value characters.',
77 | 'array' => 'The :attribute must not have more than :value items.',
78 | ],
79 | 'max' => [
80 | 'numeric' => 'The :attribute may not be greater than :max.',
81 | 'file' => 'The :attribute may not be greater than :max kilobytes.',
82 | 'string' => 'The :attribute may not be greater than :max characters.',
83 | 'array' => 'The :attribute may not have more than :max items.',
84 | ],
85 | 'mimes' => 'The :attribute must be a file of type: :values.',
86 | 'mimetypes' => 'The :attribute must be a file of type: :values.',
87 | 'min' => [
88 | 'numeric' => 'The :attribute must be at least :min.',
89 | 'file' => 'The :attribute must be at least :min kilobytes.',
90 | 'string' => 'The :attribute must be at least :min characters.',
91 | 'array' => 'The :attribute must have at least :min items.',
92 | ],
93 | 'not_in' => 'The selected :attribute is invalid.',
94 | 'not_regex' => 'The :attribute format is invalid.',
95 | 'numeric' => 'The :attribute must be a number.',
96 | 'password' => 'The password is incorrect.',
97 | 'present' => 'The :attribute field must be present.',
98 | 'regex' => 'The :attribute format is invalid.',
99 | 'required' => 'The :attribute field is required.',
100 | 'required_if' => 'The :attribute field is required when :other is :value.',
101 | 'required_unless' => 'The :attribute field is required unless :other is in :values.',
102 | 'required_with' => 'The :attribute field is required when :values is present.',
103 | 'required_with_all' => 'The :attribute field is required when :values are present.',
104 | 'required_without' => 'The :attribute field is required when :values is not present.',
105 | 'required_without_all' => 'The :attribute field is required when none of :values are present.',
106 | 'same' => 'The :attribute and :other must match.',
107 | 'size' => [
108 | 'numeric' => 'The :attribute must be :size.',
109 | 'file' => 'The :attribute must be :size kilobytes.',
110 | 'string' => 'The :attribute must be :size characters.',
111 | 'array' => 'The :attribute must contain :size items.',
112 | ],
113 | 'starts_with' => 'The :attribute must start with one of the following: :values.',
114 | 'string' => 'The :attribute must be a string.',
115 | 'timezone' => 'The :attribute must be a valid zone.',
116 | 'unique' => 'The :attribute has already been taken.',
117 | 'uploaded' => 'The :attribute failed to upload.',
118 | 'url' => 'The :attribute format is invalid.',
119 | 'uuid' => 'The :attribute must be a valid UUID.',
120 |
121 | /*
122 | |--------------------------------------------------------------------------
123 | | Custom Validation Language Lines
124 | |--------------------------------------------------------------------------
125 | |
126 | | Here you may specify custom validation messages for attributes using the
127 | | convention "attribute.rule" to name the lines. This makes it quick to
128 | | specify a specific custom language line for a given attribute rule.
129 | |
130 | */
131 |
132 | 'custom' => [
133 | 'attribute-name' => [
134 | 'rule-name' => 'custom-message',
135 | ],
136 | ],
137 |
138 | /*
139 | |--------------------------------------------------------------------------
140 | | Custom Validation Attributes
141 | |--------------------------------------------------------------------------
142 | |
143 | | The following language lines are used to swap our attribute placeholder
144 | | with something more reader friendly such as "E-Mail Address" instead
145 | | of "email". This simply helps us make our message more expressive.
146 | |
147 | */
148 |
149 | 'attributes' => [],
150 |
151 | ];
152 |
--------------------------------------------------------------------------------
/config/api.php:
--------------------------------------------------------------------------------
1 | env('API_STANDARDS_TREE', 'x'),
22 |
23 | /*
24 | |--------------------------------------------------------------------------
25 | | API Subtype
26 | |--------------------------------------------------------------------------
27 | |
28 | | Your subtype will follow the standards tree you use when used in the
29 | | "Accept" header to negotiate the content type and version.
30 | |
31 | | For example: Accept: application/x.SUBTYPE.v1+json
32 | |
33 | */
34 |
35 | 'subtype' => env('API_SUBTYPE', ''),
36 |
37 | /*
38 | |--------------------------------------------------------------------------
39 | | Default API Version
40 | |--------------------------------------------------------------------------
41 | |
42 | | This is the default version when strict mode is disabled and your API
43 | | is accessed via a web browser. It's also used as the default version
44 | | when generating your APIs documentation.
45 | |
46 | */
47 |
48 | 'version' => env('API_VERSION', 'v1'),
49 |
50 | /*
51 | |--------------------------------------------------------------------------
52 | | Default API Prefix
53 | |--------------------------------------------------------------------------
54 | |
55 | | A default prefix to use for your API routes so you don't have to
56 | | specify it for each group.
57 | |
58 | */
59 |
60 | 'prefix' => env('API_PREFIX', null),
61 |
62 | /*
63 | |--------------------------------------------------------------------------
64 | | Default API Domain
65 | |--------------------------------------------------------------------------
66 | |
67 | | A default domain to use for your API routes so you don't have to
68 | | specify it for each group.
69 | |
70 | */
71 |
72 | 'domain' => env('API_DOMAIN', null),
73 |
74 | /*
75 | |--------------------------------------------------------------------------
76 | | Name
77 | |--------------------------------------------------------------------------
78 | |
79 | | When documenting your API using the API Blueprint syntax you can
80 | | configure a default name to avoid having to manually specify
81 | | one when using the command.
82 | |
83 | */
84 |
85 | 'name' => env('API_NAME', null),
86 |
87 | /*
88 | |--------------------------------------------------------------------------
89 | | Conditional Requests
90 | |--------------------------------------------------------------------------
91 | |
92 | | Globally enable conditional requests so that an ETag header is added to
93 | | any successful response. Subsequent requests will perform a check and
94 | | will return a 304 Not Modified. This can also be enabled or disabled
95 | | on certain groups or routes.
96 | |
97 | */
98 |
99 | 'conditionalRequest' => env('API_CONDITIONAL_REQUEST', true),
100 |
101 | /*
102 | |--------------------------------------------------------------------------
103 | | Strict Mode
104 | |--------------------------------------------------------------------------
105 | |
106 | | Enabling strict mode will require clients to send a valid Accept header
107 | | with every request. This also voids the default API version, meaning
108 | | your API will not be browsable via a web browser.
109 | |
110 | */
111 |
112 | 'strict' => env('API_STRICT', false),
113 |
114 | /*
115 | |--------------------------------------------------------------------------
116 | | Debug Mode
117 | |--------------------------------------------------------------------------
118 | |
119 | | Enabling debug mode will result in error responses caused by thrown
120 | | exceptions to have a "debug" key that will be populated with
121 | | more detailed information on the exception.
122 | |
123 | */
124 |
125 | 'debug' => env('API_DEBUG', false),
126 |
127 | /*
128 | |--------------------------------------------------------------------------
129 | | Generic Error Format
130 | |--------------------------------------------------------------------------
131 | |
132 | | When some HTTP exceptions are not caught and dealt with the API will
133 | | generate a generic error response in the format provided. Any
134 | | keys that aren't replaced with corresponding values will be
135 | | removed from the final response.
136 | |
137 | */
138 |
139 | 'errorFormat' => [
140 | 'message' => ':message',
141 | 'errors' => ':errors',
142 | 'code' => ':code',
143 | 'status_code' => ':status_code',
144 | 'debug' => ':debug',
145 | ],
146 |
147 | /*
148 | |--------------------------------------------------------------------------
149 | | API Middleware
150 | |--------------------------------------------------------------------------
151 | |
152 | | Middleware that will be applied globally to all API requests.
153 | |
154 | */
155 |
156 | 'middleware' => [
157 |
158 | ],
159 |
160 | /*
161 | |--------------------------------------------------------------------------
162 | | Authentication Providers
163 | |--------------------------------------------------------------------------
164 | |
165 | | The authentication providers that should be used when attempting to
166 | | authenticate an incoming API request.
167 | |
168 | */
169 |
170 | 'auth' => [
171 | 'jwt' => 'Dingo\Api\Auth\Provider\JWT',
172 | ],
173 |
174 | /*
175 | |--------------------------------------------------------------------------
176 | | Throttling / Rate Limiting
177 | |--------------------------------------------------------------------------
178 | |
179 | | Consumers of your API can be limited to the amount of requests they can
180 | | make. You can create your own throttles or simply change the default
181 | | throttles.
182 | |
183 | */
184 |
185 | 'throttling' => [
186 |
187 | ],
188 |
189 | /*
190 | |--------------------------------------------------------------------------
191 | | Response Transformer
192 | |--------------------------------------------------------------------------
193 | |
194 | | Responses can be transformed so that they are easier to format. By
195 | | default a Fractal transformer will be used to transform any
196 | | responses prior to formatting. You can easily replace
197 | | this with your own transformer.
198 | |
199 | */
200 |
201 | 'transformer' => env('API_TRANSFORMER', Dingo\Api\Transformer\Adapter\Fractal::class),
202 |
203 | /*
204 | |--------------------------------------------------------------------------
205 | | Response Formats
206 | |--------------------------------------------------------------------------
207 | |
208 | | Responses can be returned in multiple formats by registering different
209 | | response formatters. You can also customize an existing response
210 | | formatter with a number of options to configure its output.
211 | |
212 | */
213 |
214 | 'defaultFormat' => env('API_DEFAULT_FORMAT', 'json'),
215 |
216 | 'formats' => [
217 |
218 | 'json' => Dingo\Api\Http\Response\Format\Json::class,
219 |
220 | ],
221 |
222 | 'formatsOptions' => [
223 |
224 | 'json' => [
225 | 'pretty_print' => env('API_JSON_FORMAT_PRETTY_PRINT_ENABLED', false),
226 | 'indent_style' => env('API_JSON_FORMAT_INDENT_STYLE', 'space'),
227 | 'indent_size' => env('API_JSON_FORMAT_INDENT_SIZE', 2),
228 | ],
229 |
230 | ],
231 |
232 | ];
233 |
--------------------------------------------------------------------------------
/public/avatars/5.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/config/app.php:
--------------------------------------------------------------------------------
1 | env('APP_NAME', 'Laravel'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Application Environment
21 | |--------------------------------------------------------------------------
22 | |
23 | | This value determines the "environment" your application is currently
24 | | running in. This may determine how you prefer to configure various
25 | | services the application utilizes. Set this in your ".env" file.
26 | |
27 | */
28 |
29 | 'env' => env('APP_ENV', 'production'),
30 |
31 | /*
32 | |--------------------------------------------------------------------------
33 | | Application Debug Mode
34 | |--------------------------------------------------------------------------
35 | |
36 | | When your application is in debug mode, detailed error messages with
37 | | stack traces will be shown on every error that occurs within your
38 | | application. If disabled, a simple generic error page is shown.
39 | |
40 | */
41 |
42 | 'debug' => env('APP_DEBUG', false),
43 |
44 | /*
45 | |--------------------------------------------------------------------------
46 | | Application URL
47 | |--------------------------------------------------------------------------
48 | |
49 | | This URL is used by the console to properly generate URLs when using
50 | | the Artisan command line tool. You should set this to the root of
51 | | your application so that it is used when running Artisan tasks.
52 | |
53 | */
54 |
55 | 'url' => env('APP_URL', 'http://localhost'),
56 |
57 | 'asset_url' => env('ASSET_URL', null),
58 |
59 | /*
60 | |--------------------------------------------------------------------------
61 | | Application Timezone
62 | |--------------------------------------------------------------------------
63 | |
64 | | Here you may specify the default timezone for your application, which
65 | | will be used by the PHP date and date-time functions. We have gone
66 | | ahead and set this to a sensible default for you out of the box.
67 | |
68 | */
69 |
70 | 'timezone' => 'PRC',
71 |
72 | /*
73 | |--------------------------------------------------------------------------
74 | | Application Locale Configuration
75 | |--------------------------------------------------------------------------
76 | |
77 | | The application locale determines the default locale that will be used
78 | | by the translation service provider. You are free to set this value
79 | | to any of the locales which will be supported by the application.
80 | |
81 | */
82 |
83 | 'locale' => 'zh-CN',
84 |
85 | /*
86 | |--------------------------------------------------------------------------
87 | | Application Fallback Locale
88 | |--------------------------------------------------------------------------
89 | |
90 | | The fallback locale determines the locale to use when the current one
91 | | is not available. You may change the value to correspond to any of
92 | | the language folders that are provided through your application.
93 | |
94 | */
95 |
96 | 'fallback_locale' => 'en',
97 |
98 | /*
99 | |--------------------------------------------------------------------------
100 | | Faker Locale
101 | |--------------------------------------------------------------------------
102 | |
103 | | This locale will be used by the Faker PHP library when generating fake
104 | | data for your database seeds. For example, this will be used to get
105 | | localized telephone numbers, street address information and more.
106 | |
107 | */
108 |
109 | 'faker_locale' => 'en_US',
110 |
111 | /*
112 | |--------------------------------------------------------------------------
113 | | Encryption Key
114 | |--------------------------------------------------------------------------
115 | |
116 | | This key is used by the Illuminate encrypter service and should be set
117 | | to a random, 32 character string, otherwise these encrypted strings
118 | | will not be safe. Please do this before deploying an application!
119 | |
120 | */
121 |
122 | 'key' => env('APP_KEY'),
123 |
124 | 'cipher' => 'AES-256-CBC',
125 |
126 | /*
127 | |--------------------------------------------------------------------------
128 | | Autoloaded Service Providers
129 | |--------------------------------------------------------------------------
130 | |
131 | | The service providers listed here will be automatically loaded on the
132 | | request to your application. Feel free to add your own services to
133 | | this array to grant expanded functionality to your applications.
134 | |
135 | */
136 |
137 | 'providers' => [
138 |
139 | /*
140 | * Laravel Framework Service Providers...
141 | */
142 | Illuminate\Auth\AuthServiceProvider::class,
143 | Illuminate\Broadcasting\BroadcastServiceProvider::class,
144 | Illuminate\Bus\BusServiceProvider::class,
145 | Illuminate\Cache\CacheServiceProvider::class,
146 | Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
147 | Illuminate\Cookie\CookieServiceProvider::class,
148 | Illuminate\Database\DatabaseServiceProvider::class,
149 | Illuminate\Encryption\EncryptionServiceProvider::class,
150 | Illuminate\Filesystem\FilesystemServiceProvider::class,
151 | Illuminate\Foundation\Providers\FoundationServiceProvider::class,
152 | Illuminate\Hashing\HashServiceProvider::class,
153 | Illuminate\Mail\MailServiceProvider::class,
154 | Illuminate\Notifications\NotificationServiceProvider::class,
155 | Illuminate\Pagination\PaginationServiceProvider::class,
156 | Illuminate\Pipeline\PipelineServiceProvider::class,
157 | Illuminate\Queue\QueueServiceProvider::class,
158 | Illuminate\Redis\RedisServiceProvider::class,
159 | Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
160 | Illuminate\Session\SessionServiceProvider::class,
161 | Illuminate\Translation\TranslationServiceProvider::class,
162 | Illuminate\Validation\ValidationServiceProvider::class,
163 | Illuminate\View\ViewServiceProvider::class,
164 |
165 | /*
166 | * Package Service Providers...
167 | */
168 |
169 | /*
170 | * Application Service Providers...
171 | */
172 | App\Providers\AppServiceProvider::class,
173 | App\Providers\AuthServiceProvider::class,
174 | // App\Providers\BroadcastServiceProvider::class,
175 | App\Providers\EventServiceProvider::class,
176 | App\Providers\RouteServiceProvider::class,
177 |
178 | ],
179 |
180 | /*
181 | |--------------------------------------------------------------------------
182 | | Class Aliases
183 | |--------------------------------------------------------------------------
184 | |
185 | | This array of class aliases will be registered when this application
186 | | is started. However, feel free to register as many as you wish as
187 | | the aliases are "lazy" loaded so they don't hinder performance.
188 | |
189 | */
190 |
191 | 'aliases' => [
192 |
193 | 'App' => Illuminate\Support\Facades\App::class,
194 | 'Arr' => Illuminate\Support\Arr::class,
195 | 'Artisan' => Illuminate\Support\Facades\Artisan::class,
196 | 'Auth' => Illuminate\Support\Facades\Auth::class,
197 | 'Blade' => Illuminate\Support\Facades\Blade::class,
198 | 'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
199 | 'Bus' => Illuminate\Support\Facades\Bus::class,
200 | 'Cache' => Illuminate\Support\Facades\Cache::class,
201 | 'Config' => Illuminate\Support\Facades\Config::class,
202 | 'Cookie' => Illuminate\Support\Facades\Cookie::class,
203 | 'Crypt' => Illuminate\Support\Facades\Crypt::class,
204 | 'DB' => Illuminate\Support\Facades\DB::class,
205 | 'Eloquent' => Illuminate\Database\Eloquent\Model::class,
206 | 'Event' => Illuminate\Support\Facades\Event::class,
207 | 'File' => Illuminate\Support\Facades\File::class,
208 | 'Gate' => Illuminate\Support\Facades\Gate::class,
209 | 'Hash' => Illuminate\Support\Facades\Hash::class,
210 | 'Lang' => Illuminate\Support\Facades\Lang::class,
211 | 'Log' => Illuminate\Support\Facades\Log::class,
212 | 'Mail' => Illuminate\Support\Facades\Mail::class,
213 | 'Notification' => Illuminate\Support\Facades\Notification::class,
214 | 'Password' => Illuminate\Support\Facades\Password::class,
215 | 'Queue' => Illuminate\Support\Facades\Queue::class,
216 | 'Redirect' => Illuminate\Support\Facades\Redirect::class,
217 | 'Redis' => Illuminate\Support\Facades\Redis::class,
218 | 'Request' => Illuminate\Support\Facades\Request::class,
219 | 'Response' => Illuminate\Support\Facades\Response::class,
220 | 'Route' => Illuminate\Support\Facades\Route::class,
221 | 'Schema' => Illuminate\Support\Facades\Schema::class,
222 | 'Session' => Illuminate\Support\Facades\Session::class,
223 | 'Storage' => Illuminate\Support\Facades\Storage::class,
224 | 'Str' => Illuminate\Support\Str::class,
225 | 'URL' => Illuminate\Support\Facades\URL::class,
226 | 'Validator' => Illuminate\Support\Facades\Validator::class,
227 | 'View' => Illuminate\Support\Facades\View::class,
228 |
229 | ],
230 |
231 | ];
232 |
--------------------------------------------------------------------------------
/public/avatars/8.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
153 |
--------------------------------------------------------------------------------
/config/jwt.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | return [
13 |
14 | /*
15 | |--------------------------------------------------------------------------
16 | | JWT Authentication Secret
17 | |--------------------------------------------------------------------------
18 | |
19 | | Don't forget to set this in your .env file, as it will be used to sign
20 | | your tokens. A helper command is provided for this:
21 | | `php artisan jwt:secret`
22 | |
23 | | Note: This will be used for Symmetric algorithms only (HMAC),
24 | | since RSA and ECDSA use a private/public key combo (See below).
25 | |
26 | */
27 |
28 | 'secret' => env('JWT_SECRET'),
29 |
30 | /*
31 | |--------------------------------------------------------------------------
32 | | JWT Authentication Keys
33 | |--------------------------------------------------------------------------
34 | |
35 | | The algorithm you are using, will determine whether your tokens are
36 | | signed with a random string (defined in `JWT_SECRET`) or using the
37 | | following public & private keys.
38 | |
39 | | Symmetric Algorithms:
40 | | HS256, HS384 & HS512 will use `JWT_SECRET`.
41 | |
42 | | Asymmetric Algorithms:
43 | | RS256, RS384 & RS512 / ES256, ES384 & ES512 will use the keys below.
44 | |
45 | */
46 |
47 | 'keys' => [
48 |
49 | /*
50 | |--------------------------------------------------------------------------
51 | | Public Key
52 | |--------------------------------------------------------------------------
53 | |
54 | | A path or resource to your public key.
55 | |
56 | | E.g. 'file://path/to/public/key'
57 | |
58 | */
59 |
60 | 'public' => env('JWT_PUBLIC_KEY'),
61 |
62 | /*
63 | |--------------------------------------------------------------------------
64 | | Private Key
65 | |--------------------------------------------------------------------------
66 | |
67 | | A path or resource to your private key.
68 | |
69 | | E.g. 'file://path/to/private/key'
70 | |
71 | */
72 |
73 | 'private' => env('JWT_PRIVATE_KEY'),
74 |
75 | /*
76 | |--------------------------------------------------------------------------
77 | | Passphrase
78 | |--------------------------------------------------------------------------
79 | |
80 | | The passphrase for your private key. Can be null if none set.
81 | |
82 | */
83 |
84 | 'passphrase' => env('JWT_PASSPHRASE'),
85 |
86 | ],
87 |
88 | /*
89 | |--------------------------------------------------------------------------
90 | | JWT time to live
91 | |--------------------------------------------------------------------------
92 | |
93 | | Specify the length of time (in minutes) that the token will be valid for.
94 | | Defaults to 1 hour.
95 | |
96 | | You can also set this to null, to yield a never expiring token.
97 | | Some people may want this behaviour for e.g. a mobile app.
98 | | This is not particularly recommended, so make sure you have appropriate
99 | | systems in place to revoke the token if necessary.
100 | | Notice: If you set this to null you should remove 'exp' element from 'required_claims' list.
101 | |
102 | */
103 |
104 | 'ttl' => env('JWT_TTL', 60),
105 |
106 | /*
107 | |--------------------------------------------------------------------------
108 | | Refresh time to live
109 | |--------------------------------------------------------------------------
110 | |
111 | | Specify the length of time (in minutes) that the token can be refreshed
112 | | within. I.E. The user can refresh their token within a 2 week window of
113 | | the original token being created until they must re-authenticate.
114 | | Defaults to 2 weeks.
115 | |
116 | | You can also set this to null, to yield an infinite refresh time.
117 | | Some may want this instead of never expiring tokens for e.g. a mobile app.
118 | | This is not particularly recommended, so make sure you have appropriate
119 | | systems in place to revoke the token if necessary.
120 | |
121 | */
122 |
123 | 'refresh_ttl' => env('JWT_REFRESH_TTL', 20160),
124 |
125 | /*
126 | |--------------------------------------------------------------------------
127 | | JWT hashing algorithm
128 | |--------------------------------------------------------------------------
129 | |
130 | | Specify the hashing algorithm that will be used to sign the token.
131 | |
132 | | See here: https://github.com/namshi/jose/tree/master/src/Namshi/JOSE/Signer/OpenSSL
133 | | for possible values.
134 | |
135 | */
136 |
137 | 'algo' => env('JWT_ALGO', 'HS256'),
138 |
139 | /*
140 | |--------------------------------------------------------------------------
141 | | Required Claims
142 | |--------------------------------------------------------------------------
143 | |
144 | | Specify the required claims that must exist in any token.
145 | | A TokenInvalidException will be thrown if any of these claims are not
146 | | present in the payload.
147 | |
148 | */
149 |
150 | 'required_claims' => [
151 | 'iss',
152 | 'iat',
153 | 'exp',
154 | 'nbf',
155 | 'sub',
156 | 'jti',
157 | ],
158 |
159 | /*
160 | |--------------------------------------------------------------------------
161 | | Persistent Claims
162 | |--------------------------------------------------------------------------
163 | |
164 | | Specify the claim keys to be persisted when refreshing a token.
165 | | `sub` and `iat` will automatically be persisted, in
166 | | addition to the these claims.
167 | |
168 | | Note: If a claim does not exist then it will be ignored.
169 | |
170 | */
171 |
172 | 'persistent_claims' => [
173 | // 'foo',
174 | // 'bar',
175 | ],
176 |
177 | /*
178 | |--------------------------------------------------------------------------
179 | | Lock Subject
180 | |--------------------------------------------------------------------------
181 | |
182 | | This will determine whether a `prv` claim is automatically added to
183 | | the token. The purpose of this is to ensure that if you have multiple
184 | | authentication models e.g. `App\User` & `App\OtherPerson`, then we
185 | | should prevent one authentication request from impersonating another,
186 | | if 2 tokens happen to have the same id across the 2 different models.
187 | |
188 | | Under specific circumstances, you may want to disable this behaviour
189 | | e.g. if you only have one authentication model, then you would save
190 | | a little on token size.
191 | |
192 | */
193 |
194 | 'lock_subject' => true,
195 |
196 | /*
197 | |--------------------------------------------------------------------------
198 | | Leeway
199 | |--------------------------------------------------------------------------
200 | |
201 | | This property gives the jwt timestamp claims some "leeway".
202 | | Meaning that if you have any unavoidable slight clock skew on
203 | | any of your servers then this will afford you some level of cushioning.
204 | |
205 | | This applies to the claims `iat`, `nbf` and `exp`.
206 | |
207 | | Specify in seconds - only if you know you need it.
208 | |
209 | */
210 |
211 | 'leeway' => env('JWT_LEEWAY', 0),
212 |
213 | /*
214 | |--------------------------------------------------------------------------
215 | | Blacklist Enabled
216 | |--------------------------------------------------------------------------
217 | |
218 | | In order to invalidate tokens, you must have the blacklist enabled.
219 | | If you do not want or need this functionality, then set this to false.
220 | |
221 | */
222 |
223 | 'blacklist_enabled' => env('JWT_BLACKLIST_ENABLED', true),
224 |
225 | /*
226 | | -------------------------------------------------------------------------
227 | | Blacklist Grace Period
228 | | -------------------------------------------------------------------------
229 | |
230 | | When multiple concurrent requests are made with the same JWT,
231 | | it is possible that some of them fail, due to token regeneration
232 | | on every request.
233 | |
234 | | Set grace period in seconds to prevent parallel request failure.
235 | |
236 | */
237 |
238 | 'blacklist_grace_period' => env('JWT_BLACKLIST_GRACE_PERIOD', 0),
239 |
240 | /*
241 | |--------------------------------------------------------------------------
242 | | Cookies encryption
243 | |--------------------------------------------------------------------------
244 | |
245 | | By default Laravel encrypt cookies for security reason.
246 | | If you decide to not decrypt cookies, you will have to configure Laravel
247 | | to not encrypt your cookie token by adding its name into the $except
248 | | array available in the middleware "EncryptCookies" provided by Laravel.
249 | | see https://laravel.com/docs/master/responses#cookies-and-encryption
250 | | for details.
251 | |
252 | | Set it to true if you want to decrypt cookies.
253 | |
254 | */
255 |
256 | 'decrypt_cookies' => false,
257 |
258 | /*
259 | |--------------------------------------------------------------------------
260 | | Providers
261 | |--------------------------------------------------------------------------
262 | |
263 | | Specify the various providers used throughout the package.
264 | |
265 | */
266 |
267 | 'providers' => [
268 |
269 | /*
270 | |--------------------------------------------------------------------------
271 | | JWT Provider
272 | |--------------------------------------------------------------------------
273 | |
274 | | Specify the provider that is used to create and decode the tokens.
275 | |
276 | */
277 |
278 | 'jwt' => Tymon\JWTAuth\Providers\JWT\Lcobucci::class,
279 |
280 | /*
281 | |--------------------------------------------------------------------------
282 | | Authentication Provider
283 | |--------------------------------------------------------------------------
284 | |
285 | | Specify the provider that is used to authenticate users.
286 | |
287 | */
288 |
289 | 'auth' => Tymon\JWTAuth\Providers\Auth\Illuminate::class,
290 |
291 | /*
292 | |--------------------------------------------------------------------------
293 | | Storage Provider
294 | |--------------------------------------------------------------------------
295 | |
296 | | Specify the provider that is used to store tokens in the blacklist.
297 | |
298 | */
299 |
300 | 'storage' => Tymon\JWTAuth\Providers\Storage\Illuminate::class,
301 |
302 | ],
303 |
304 | ];
305 |
--------------------------------------------------------------------------------