File tree Expand file tree Collapse file tree 9 files changed +629
-0
lines changed
Expand file tree Collapse file tree 9 files changed +629
-0
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "name" : " code4mk/kauth" ,
3+ "description" : " kauth is JWT API Authentication ( jwt-auth ) for laravel" ,
4+ "keywords" : [
5+ " jwt" ,
6+ " jwt-auth" ,
7+ " laravel" ,
8+ " laravel-jwt" ,
9+ " auth" ,
10+ " code4mk" ,
11+ " 0devco" ,
12+ " api"
13+ ],
14+ "homepage" : " https://github.com/code4mk/kauth" ,
15+ "support" : {
16+ "issues" : " https://github.com/code4mk/kauth/issues" ,
17+ "source" : " https://github.com/code4mk/kauth"
18+ },
19+ "license" : " MIT" ,
20+ "authors" : [
21+ {
22+ "name" : " code4mk" ,
23+ "email" : " hiremostafa@gmail.com" ,
24+ "website" : " https://code4mk.org"
25+ }
26+ ],
27+ "require" : {
28+ "firebase/php-jwt" : " ^5.0"
29+ },
30+ "autoload" : {
31+ "psr-4" : {
32+ "Kauth\\ " : " src/"
33+ }
34+ },
35+ "extra" : {
36+ "laravel" : {
37+ "providers" : [
38+ " Kauth\\ KauthServiceProvider"
39+ ]
40+ }
41+ },
42+ "prefer-stable" : true ,
43+ "minimum-stability" : " dev"
44+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ return [
4+ /*
5+ |--------------------------------------------------------------------------
6+ | Kauth token key name
7+ |--------------------------------------------------------------------------
8+ |
9+ | You can set your desired token key name for request header
10+ | client side / axios headers name as (Authorization)
11+ | default is tokon
12+ */
13+
14+ "token_header_name " => "" ,
15+
16+ /*
17+ |--------------------------------------------------------------------------
18+ | Kauth token expired duration
19+ |--------------------------------------------------------------------------
20+ |
21+ | You can set duration of your token
22+ | pattern will be follow P7Y5M4DT4H3M2S
23+ | http://php.net/manual/en/datetime.gettimestamp.php
24+ */
25+
26+ "token_exp " => "" ,
27+
28+ /*
29+ |--------------------------------------------------------------------------
30+ | Kauth jwt payload iss and aud
31+ |--------------------------------------------------------------------------
32+ |
33+ | You can set jwt iss
34+ |
35+ | your url host name
36+ */
37+ "payload " => [
38+ "iss " => ""
39+ ],
40+
41+ /*
42+ |--------------------------------------------------------------------------
43+ | Kauth cookie auth
44+ |--------------------------------------------------------------------------
45+ |
46+ | You can use for socialite system
47+ |
48+ |
49+ */
50+
51+ "cookie_auth " => false ,
52+
53+ /*
54+ |--------------------------------------------------------------------------
55+ | Kauth guard setup
56+ |--------------------------------------------------------------------------
57+ |
58+ | You can set guard
59+ | set table name
60+ |
61+ */
62+
63+ "guard " => [
64+ "users " => [
65+ "table " => "users " ,
66+ ],
67+ ],
68+ ];
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use Illuminate \Support \Facades \Schema ;
4+ use Illuminate \Database \Schema \Blueprint ;
5+ use Illuminate \Database \Migrations \Migration ;
6+
7+ class CreateKauthTable extends Migration
8+ {
9+ /**
10+ * Run the migrations.
11+ *
12+ * @return void
13+ */
14+ public function up ()
15+ {
16+ Schema::create ('kauth ' , function (Blueprint $ table ) {
17+ $ table ->increments ('id ' );
18+ $ table ->text ('tokon ' )->nullable ();
19+ $ table ->integer ('user_id ' )->nullable ();
20+ $ table ->integer ('iat ' )->nullable ();
21+ $ table ->integer ('exp ' )->nullable ();
22+ $ table ->string ('ip ' )->nullable ();
23+ $ table ->string ('browser ' )->nullable ();
24+ $ table ->string ('device ' )->nullable ();
25+ $ table ->string ('os ' )->nullable ();
26+ $ table ->string ('login ' )->nullable ();
27+ $ table ->string ('guard ' )->nullable ();
28+ $ table ->string ('user_type ' )->nullable ();
29+ $ table ->boolean ('active ' )->default (true );
30+ $ table ->timestamps ();
31+ });
32+ }
33+
34+ /**
35+ * Reverse the migrations.
36+ *
37+ * @return void
38+ */
39+ public function down ()
40+ {
41+ Schema::dropIfExists ('kauth ' );
42+ }
43+ }
You can’t perform that action at this time.
0 commit comments