├── .gitignore
├── LICENSE
├── README.md
├── app
├── Console
│ └── Kernel.php
├── Exceptions
│ └── Handler.php
├── Helpers
│ └── Helper.php
├── Http
│ ├── Controllers
│ │ ├── Api
│ │ │ ├── AppController.php
│ │ │ ├── AuthController.php
│ │ │ ├── ChartController.php
│ │ │ ├── CodeController.php
│ │ │ ├── PasswordResetController.php
│ │ │ └── VisitorController.php
│ │ ├── AppController.php
│ │ ├── Auth
│ │ │ ├── ForgotPasswordController.php
│ │ │ ├── LoginController.php
│ │ │ ├── RegisterController.php
│ │ │ ├── ResetPasswordController.php
│ │ │ └── VerificationController.php
│ │ ├── CodeController.php
│ │ ├── Controller.php
│ │ ├── FeedbackController.php
│ │ ├── GuestController.php
│ │ ├── HomeController.php
│ │ ├── PasswordController.php
│ │ └── VisitorController.php
│ ├── Kernel.php
│ └── Middleware
│ │ ├── Authenticate.php
│ │ ├── CheckForMaintenanceMode.php
│ │ ├── Cors.php
│ │ ├── EncryptCookies.php
│ │ ├── IsAdmin.php
│ │ ├── IsUser.php
│ │ ├── RedirectIfAuthenticated.php
│ │ ├── TrimStrings.php
│ │ ├── TrustProxies.php
│ │ └── VerifyCsrfToken.php
├── Models
│ ├── App.php
│ ├── Code.php
│ ├── Feedback.php
│ ├── PasswordReset.php
│ └── Visitor.php
├── Notifications
│ ├── PasswordResetRequest.php
│ ├── PasswordResetSuccess.php
│ └── SignupActivate.php
├── Providers
│ ├── AppServiceProvider.php
│ ├── AuthServiceProvider.php
│ ├── BroadcastServiceProvider.php
│ ├── EventServiceProvider.php
│ └── RouteServiceProvider.php
├── Rules
│ ├── VerifyAppCodeId.php
│ └── VerifyAppSecretKey.php
└── User.php
├── artisan
├── bootstrap
├── app.php
└── cache
│ └── .gitignore
├── composer.json
├── composer.lock
├── config
├── app.php
├── auth.php
├── broadcasting.php
├── cache.php
├── cors.php
├── database.php
├── filesystems.php
├── hashing.php
├── laravolt
│ └── avatar.php
├── logging.php
├── mail.php
├── queue.php
├── services.php
├── session.php
└── view.php
├── database
├── .gitignore
├── factories
│ └── UserFactory.php
├── migrations
│ ├── 2014_10_12_000000_create_users_table.php
│ ├── 2014_10_12_100000_create_password_resets_table.php
│ └── 2019_08_19_000000_create_failed_jobs_table.php
└── seeds
│ └── DatabaseSeeder.php
├── package-lock.json
├── package.json
├── phpunit.xml
├── public
├── .htaccess
├── css
│ └── app.css
├── favicon.ico
├── index.php
├── js
│ └── app.js
├── mix-manifest.json
└── robots.txt
├── resources
├── js
│ ├── app.js
│ ├── bootstrap.js
│ └── components
│ │ └── ExampleComponent.vue
├── lang
│ └── en
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
├── sass
│ ├── _variables.scss
│ └── app.scss
└── views
│ ├── app-create.blade.php
│ ├── app-edit.blade.php
│ ├── app-show.blade.php
│ ├── auth
│ ├── login.blade.php
│ ├── passwords
│ │ ├── email.blade.php
│ │ └── reset.blade.php
│ ├── register.blade.php
│ └── verify.blade.php
│ ├── change-password.blade.php
│ ├── code
│ ├── edit.blade.php
│ └── show.blade.php
│ ├── feedback
│ ├── create.blade.php
│ └── index.blade.php
│ ├── home.blade.php
│ ├── inc
│ ├── flash-message.blade.php
│ └── nav.blade.php
│ ├── layouts
│ └── app.blade.php
│ ├── list-app.blade.php
│ ├── list-code.blade.php
│ ├── visitor
│ └── index.blade.php
│ └── welcome.blade.php
├── routes
├── api.php
├── channels.php
├── console.php
└── web.php
├── schema.sql
├── server.php
├── tests
├── CreatesApplication.php
├── Feature
│ └── ExampleTest.php
├── TestCase.php
└── Unit
│ └── ExampleTest.php
└── webpack.mix.js
/.gitignore:
--------------------------------------------------------------------------------
1 | /vendor/
2 | node_modules/
3 | npm-debug.log
4 | yarn-error.log
5 |
6 | # Laravel 4 specific
7 | bootstrap/compiled.php
8 | app/storage/
9 |
10 | # Laravel 5 & Lumen specific
11 | public/storage
12 | public/hot
13 |
14 | # Laravel 5 & Lumen specific with changed public path
15 | public_html/storage
16 | public_html/hot
17 |
18 | storage/
19 | .env
20 | Homestead.yaml
21 | Homestead.json
22 | /.vagrant
23 | .phpunit.result.cache
24 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # SOA Ultimate QR Code Generator
2 |
3 | Version v1.1
4 |
5 | SOA Ultimate QR Generator is a free and open source SaaS platform to create dynamic QR Codes for URL Analytics.
6 |
7 | URL: https://dev61.onlinetestingserver.com/soa_qrcodes/
8 |
9 | API Documentation Link: https://documenter.getpostman.com/view/7079710/SVzz4Ka7
10 |
11 | Release notes:
12 |
13 | Features:
14 | + Add multiple applications
15 | + Generate Dynamic QR Codes with different sizes
16 | + Data Visualization with Google Geo Chart
17 | + Tracks IP Address, Country, City, Region, location (longitude and latitude)
18 |
--------------------------------------------------------------------------------
/app/Console/Kernel.php:
--------------------------------------------------------------------------------
1 | command('inspire')
28 | // ->hourly();
29 | }
30 |
31 | /**
32 | * Register the commands for the application.
33 | *
34 | * @return void
35 | */
36 | protected function commands()
37 | {
38 | $this->load(__DIR__.'/Commands');
39 |
40 | require base_path('routes/console.php');
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/app/Exceptions/Handler.php:
--------------------------------------------------------------------------------
1 | user();
19 |
20 | $result = App::whereUserId($user->id)->orderBy('id', 'desc')->get();
21 |
22 | if ($result->isEmpty()) {
23 | return response()->json([
24 | 'message' => 'Record Not Found'
25 | ], 404);
26 | }
27 |
28 | return response()->json($result, 302);
29 |
30 |
31 | }
32 |
33 | /**
34 | * Show the form for creating a new resource.
35 | *
36 | * @return \Illuminate\Http\Response
37 | */
38 | public function create()
39 | {
40 | //
41 | }
42 |
43 | /**
44 | * Store a newly created resource in storage.
45 | *
46 | * @param \Illuminate\Http\Request $request
47 | * @return \Illuminate\Http\Response
48 | */
49 | public function store(Request $request)
50 | {
51 | //
52 | }
53 |
54 | /**
55 | * Display the specified resource.
56 | *
57 | * @param int $id
58 | * @return \Illuminate\Http\Response
59 | */
60 | public function show($id)
61 | {
62 | //
63 | }
64 |
65 | /**
66 | * Show the form for editing the specified resource.
67 | *
68 | * @param int $id
69 | * @return \Illuminate\Http\Response
70 | */
71 | public function edit($id)
72 | {
73 | //
74 | }
75 |
76 | /**
77 | * Update the specified resource in storage.
78 | *
79 | * @param \Illuminate\Http\Request $request
80 | * @param int $id
81 | * @return \Illuminate\Http\Response
82 | */
83 | public function update(Request $request, $id)
84 | {
85 | //
86 | }
87 |
88 | /**
89 | * Remove the specified resource from storage.
90 | *
91 | * @param int $id
92 | * @return \Illuminate\Http\Response
93 | */
94 | public function destroy($id)
95 | {
96 | //
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Api/AuthController.php:
--------------------------------------------------------------------------------
1 | validate([
29 | 'name' => 'required|string',
30 | 'email' => 'required|string|email|unique:users',
31 | 'password' => 'required|string|confirmed'
32 | ]);
33 |
34 | $user = new User([
35 | 'name' => $request->name,
36 | 'email' => $request->email,
37 | 'password' => bcrypt($request->password),
38 | 'activation_token' => Str::random(10)
39 | ]);
40 |
41 | $user->save();
42 |
43 | $avatar = Avatar::create($user->name)->getImageObject()->encode('png');
44 |
45 | Storage::put('public/avatars/' . $user->id . '/avatar.png', (string)$avatar);
46 |
47 | $user->notify(new SignupActivate($user));
48 |
49 | return response()->json([
50 | 'message' => 'Successfully created user!'
51 | ], 201);
52 |
53 | }
54 |
55 | public function signupActivate($token)
56 | {
57 | $user = User::where('activation_token', $token)->first();
58 | if (!$user) {
59 | return response()->json([
60 | 'message' => 'This activation token is invalid.'
61 | ], 404);
62 | }
63 | $user->active = true;
64 | $user->activation_token = '';
65 | $user->save();
66 | return $user;
67 | }
68 |
69 | /**
70 | * Login user and create token
71 | *
72 | * @param [string] email
73 | * @param [string] password
74 | * @param [boolean] remember_me
75 | * @return [string] access_token
76 | * @return [string] token_type
77 | * @return [string] expires_at
78 | */
79 | public function login(Request $request)
80 | {
81 | $request->validate([
82 | 'email' => 'required|string|email',
83 | 'password' => 'required|string',
84 | 'remember_me' => 'boolean'
85 | ]);
86 |
87 | $credentials = request(['email', 'password']);
88 |
89 | if (!Auth::attempt($credentials))
90 | return response()->json([
91 | 'message' => 'Invalid email or password!'
92 | ], 401);
93 |
94 | $user = $request->user();
95 |
96 |
97 | if($user->email_verified_at == null){
98 | return response()->json([
99 | 'message' => 'Please verify your email!'
100 | ], 401);
101 | }
102 |
103 | if($user->deleted_at != null){
104 | return response()->json([
105 | 'message' => 'Your account has been removed!'
106 | ], 401);
107 | }
108 |
109 | $tokenResult = $user->createToken('Personal Access Token');
110 |
111 | $token = $tokenResult->token;
112 |
113 | if ($request->remember_me)
114 | $token->expires_at = Carbon::now()->addWeeks(1);
115 | $token->save();
116 |
117 | return response()->json([
118 | 'access_token' => $tokenResult->accessToken,
119 | 'token_type' => 'Bearer',
120 | 'expires_at' => Carbon::parse($tokenResult->token->expires_at)->toDateTimeString()
121 | ]);
122 | }
123 |
124 | /**
125 | * Logout user (Revoke the token)
126 | *
127 | * @return [string] message
128 | */
129 | public function logout(Request $request)
130 | {
131 | $request->user()->token()->revoke();
132 | return response()->json([
133 | 'message' => 'Successfully logged out'
134 | ]);
135 | }
136 |
137 | /**
138 | * Get the authenticated User
139 | *
140 | * @return [json] user object
141 | */
142 | public function user(Request $request)
143 | {
144 | return response()->json($request->user());
145 | }
146 | }
147 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Api/ChartController.php:
--------------------------------------------------------------------------------
1 | select('country', DB::raw('count(*) as visitors'))
53 | ->whereCodeId($id)
54 | ->groupBy('country')
55 | ->get();
56 |
57 | }
58 |
59 | /**
60 | * Show the form for editing the specified resource.
61 | *
62 | * @param int $id
63 | * @return \Illuminate\Http\Response
64 | */
65 | public function edit($id)
66 | {
67 | //
68 | }
69 |
70 | /**
71 | * Update the specified resource in storage.
72 | *
73 | * @param \Illuminate\Http\Request $request
74 | * @param int $id
75 | * @return \Illuminate\Http\Response
76 | */
77 | public function update(Request $request, $id)
78 | {
79 | //
80 | }
81 |
82 | /**
83 | * Remove the specified resource from storage.
84 | *
85 | * @param int $id
86 | * @return \Illuminate\Http\Response
87 | */
88 | public function destroy($id)
89 | {
90 | //
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Api/CodeController.php:
--------------------------------------------------------------------------------
1 | validate([
25 | 'app_key' => ['required', 'string', 'exists:apps,app_key'],
26 | 'secret_key' => ['required', 'string', new VerifyAppSecretKey($request->app_key)],
27 | ]);
28 |
29 | $result = App::with('codes')->whereAppKey($request->app_key)->first();
30 |
31 | if(!$result->codes){
32 | return response()->json([
33 | 'message' => 'Record not found.'
34 | ], 404);
35 | }
36 |
37 | return response()->json($result->codes);
38 |
39 | }
40 |
41 | /**
42 | * Show the form for creating a new resource.
43 | *
44 | * @return \Illuminate\Http\Response
45 | */
46 | public function create()
47 | {
48 |
49 | }
50 |
51 | /**
52 | * Store a newly created resource in storage.
53 | *
54 | * @param \Illuminate\Http\Request $request
55 | * @return \Illuminate\Http\Response
56 | */
57 | public function store(Request $request)
58 | {
59 | $user = $request->user();
60 |
61 | $request->validate([
62 | 'app_key' => ['required', 'string', 'exists:apps,app_key'],
63 | 'secret_key' => ['required', 'string', new VerifyAppSecretKey($request->app_key)],
64 | 'name' => ['required', 'string', 'max:50'],
65 | 'url' => ['required', 'url'],
66 | 'code_size' => ['required', 'numeric'],
67 | ]);
68 |
69 | $app = App::whereAppKey($request->app_key)->first();
70 |
71 | $code = new Code();
72 | $code->app_id = $app->id;
73 | $code->url = $request->url;
74 | $code->name = $request->name;
75 | $code->dated = date('Y-m-d');
76 | $code->code = "image.png";
77 | $code->created_by = $user->id;
78 | $code->updated_by = $user->id;
79 | $code->save();
80 |
81 | $result = QR::format('png')->size($request->code_size)->generate(url('/redirect/' . $code->id));
82 | Storage::put('public/codes/' . $code->id . '/image.png', (string)$result);
83 |
84 | return response()->json([
85 | 'qr_code' => $code->code
86 | ], 201);
87 |
88 | }
89 |
90 | /**
91 | * Display the specified resource.
92 | *
93 | * @param int $id
94 | * @return \Illuminate\Http\Response
95 | */
96 | public function show(Request $request)
97 | {
98 | $user = $request->user();
99 |
100 | $fieldsToValidate = [
101 | 'app_key' => ['required', 'string', 'exists:apps,app_key'],
102 | 'secret_key' => ['required', 'string', new VerifyAppSecretKey($request->app_key)],
103 | 'code_id' => ['required', 'integer', 'exists:codes,id', new VerifyAppCodeId($request->app_key, $request->secret_key)],
104 | ];
105 |
106 | $request->validate($fieldsToValidate);
107 |
108 | $code = Code::with(['app', 'visitors'])->whereId($request->code_id)->first();
109 |
110 | if (!$code) {
111 | return response()->json([
112 | 'message' => 'Record not found.'
113 | ], 404);
114 | }
115 |
116 | return response()->json($code, 200);
117 | }
118 |
119 | /**
120 | * Show the form for editing the specified resource.
121 | *
122 | * @param int $id
123 | * @return \Illuminate\Http\Response
124 | */
125 | public function edit($id)
126 | {
127 | //
128 | }
129 |
130 | /**
131 | * Update the specified resource in storage.
132 | *
133 | * @param \Illuminate\Http\Request $request
134 | * @param int $id
135 | * @return \Illuminate\Http\Response
136 | */
137 | public function update(Request $request)
138 | {
139 | $user = $request->user();
140 |
141 | $fieldsToValidate = [
142 | 'app_key' => ['required', 'string', 'exists:apps,app_key'],
143 | 'secret_key' => ['required', 'string', new VerifyAppSecretKey($request->app_key)],
144 | 'id' => ['required', 'integer', 'exists:codes,id', new VerifyAppCodeId($request->app_key, $request->secret_key)],
145 | 'url' => ['required', 'url'],
146 | 'name' => ['required', 'string', 'max:50'],
147 | ];
148 |
149 | $request->validate($fieldsToValidate);
150 |
151 | $code = Code::whereId($request->id)->first();
152 |
153 | if (!$code) {
154 | return response()->json([
155 | 'message' => 'Record not found.'
156 | ], 404);
157 | }
158 |
159 | $code->url = $request->url;
160 | $code->name = $request->name;
161 | $code->save();
162 |
163 | return response()->json($code, 200);
164 | }
165 |
166 | /**
167 | * Remove the specified resource from storage.
168 | *
169 | * @param int $id
170 | * @return \Illuminate\Http\Response
171 | */
172 | public function destroy($id)
173 | {
174 | //
175 | }
176 | }
177 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Api/PasswordResetController.php:
--------------------------------------------------------------------------------
1 | validate([
24 | 'email' => 'required|string|email',
25 | ]);
26 | $user = User::where('email', $request->email)->first();
27 | if (!$user)
28 | return response()->json([
29 | 'message' => 'We cant find a user with that e-mail address.'
30 | ], 404);
31 | $passwordReset = PasswordReset::updateOrCreate(
32 | ['email' => $user->email],
33 | [
34 | 'email' => $user->email,
35 | 'token' => str_random(60)
36 | ]
37 | );
38 | if ($user && $passwordReset)
39 | $user->notify(
40 | new PasswordResetRequest($passwordReset->token)
41 | );
42 | return response()->json([
43 | 'message' => 'We have e-mailed your password reset link!'
44 | ]);
45 | }
46 |
47 | /**
48 | * Find token password reset
49 | *
50 | * @param [string] $token
51 | * @return [string] message
52 | * @return [json] passwordReset object
53 | */
54 | public function find($token)
55 | {
56 | $passwordReset = PasswordReset::where('token', $token)
57 | ->first();
58 | if (!$passwordReset)
59 | return response()->json([
60 | 'message' => 'This password reset token is invalid.'
61 | ], 404);
62 | if (Carbon::parse($passwordReset->updated_at)->addMinutes(720)->isPast()) {
63 | $passwordReset->delete();
64 | return response()->json([
65 | 'message' => 'This password reset token is invalid.'
66 | ], 404);
67 | }
68 | return response()->json($passwordReset);
69 | }
70 |
71 | /**
72 | * Reset password
73 | *
74 | * @param [string] email
75 | * @param [string] password
76 | * @param [string] password_confirmation
77 | * @param [string] token
78 | * @return [string] message
79 | * @return [json] user object
80 | */
81 | public function reset(Request $request)
82 | {
83 | $request->validate([
84 | 'email' => 'required|string|email',
85 | 'password' => 'required|string|confirmed',
86 | 'token' => 'required|string'
87 | ]);
88 | $passwordReset = PasswordReset::where([
89 | ['token', $request->token],
90 | ['email', $request->email]
91 | ])->first();
92 | if (!$passwordReset)
93 | return response()->json([
94 | 'message' => 'This password reset token is invalid.'
95 | ], 404);
96 | $user = User::where('email', $passwordReset->email)->first();
97 | if (!$user)
98 | return response()->json([
99 | 'message' => 'We cant find a user with that e-mail address.'
100 | ], 404);
101 | $user->password = bcrypt($request->password);
102 | $user->save();
103 | $passwordReset->delete();
104 | $user->notify(new PasswordResetSuccess($passwordReset));
105 | return response()->json($user);
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Api/VisitorController.php:
--------------------------------------------------------------------------------
1 | user();
22 |
23 | $request->validate([
24 | 'app_key' => ['required', 'string', 'exists:apps,app_key'],
25 | 'secret_key' => ['required', 'string', new VerifyAppSecretKey($request->app_key)],
26 | 'code_id' => ['required', 'integer', 'exists:codes,id'],
27 | ]);
28 |
29 |
30 | }
31 |
32 | /**
33 | * Show the form for creating a new resource.
34 | *
35 | * @return \Illuminate\Http\Response
36 | */
37 | public function create()
38 | {
39 | //
40 | }
41 |
42 | /**
43 | * Store a newly created resource in storage.
44 | *
45 | * @param \Illuminate\Http\Request $request
46 | * @return \Illuminate\Http\Response
47 | */
48 | public function store(Request $request)
49 | {
50 | //
51 | }
52 |
53 | /**
54 | * Display the specified resource.
55 | *
56 | * @param int $id
57 | * @return \Illuminate\Http\Response
58 | */
59 | public function show($id)
60 | {
61 | //
62 | }
63 |
64 | /**
65 | * Show the form for editing the specified resource.
66 | *
67 | * @param int $id
68 | * @return \Illuminate\Http\Response
69 | */
70 | public function edit($id)
71 | {
72 | //
73 | }
74 |
75 | /**
76 | * Update the specified resource in storage.
77 | *
78 | * @param \Illuminate\Http\Request $request
79 | * @param int $id
80 | * @return \Illuminate\Http\Response
81 | */
82 | public function update(Request $request, $id)
83 | {
84 | //
85 | }
86 |
87 | /**
88 | * Remove the specified resource from storage.
89 | *
90 | * @param int $id
91 | * @return \Illuminate\Http\Response
92 | */
93 | public function destroy($id)
94 | {
95 | //
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/app/Http/Controllers/AppController.php:
--------------------------------------------------------------------------------
1 | middleware(['auth', 'verified']);
14 | }
15 |
16 | /**
17 | * Display a listing of the resource.
18 | *
19 | * @return \Illuminate\Http\Response
20 | */
21 | public function index(Request $request)
22 | {
23 | $user = $request->user();
24 |
25 | $this->data['Title'] = 'My Apps';
26 |
27 | $this->data['Apps'] = App::whereUserId($user->id)->orderBy('id', 'desc')->get();
28 |
29 | return view('list-app', $this->data);
30 |
31 | }
32 |
33 | /**
34 | * Show the form for creating a new resource.
35 | *
36 | * @return \Illuminate\Http\Response
37 | */
38 | public function create(Request $request)
39 | {
40 | $this->data['Title'] = 'Create App';
41 |
42 | return view('app-create', $this->data);
43 |
44 | }
45 |
46 | /**
47 | * Store a newly created resource in storage.
48 | *
49 | * @param \Illuminate\Http\Request $request
50 | * @return \Illuminate\Http\Response
51 | */
52 | public function store(Request $request)
53 | {
54 | $user = $request->user();
55 |
56 | $fieldsToValidate = [
57 | 'name' => 'required|string|max:50',
58 | 'description' => 'required|string|max:180',
59 | 'domain' => 'required|url'
60 | ];
61 |
62 | $request->validate($fieldsToValidate);
63 |
64 | $newApp = new App();
65 | $newApp->user_id = $user->id;
66 | $newApp->name = $request->name;
67 | $newApp->description = $request->description;
68 | $newApp->domain = $request->domain;
69 | $newApp->created_by = $user->id;
70 | $newApp->updated_by = $user->id;
71 | $newApp->save();
72 |
73 | $newApp->app_key = md5($newApp->id . time());
74 | $newApp->secret_key = bcrypt($user->id . '|' . $request->name . '|' . $request->description . '|' . $request->domain . '|' . $newApp->id);
75 | $newApp->save();
76 |
77 | return back()->with('success', "App Has Been Created!");
78 |
79 | }
80 |
81 | /**
82 | * Display the specified resource.
83 | *
84 | * @param int $id
85 | * @return \Illuminate\Http\Response
86 | */
87 | public function show($id)
88 | {
89 | $user = Auth::user();
90 |
91 | $result = App::whereUserId($user->id)->whereId($id)->first();
92 |
93 | if (!$result) {
94 | return back()->with('error', 'Record Not Found');
95 | }
96 |
97 | $this->data['Title'] = 'View App';
98 | $this->data['App'] = $result;
99 |
100 | return view('app-show', $this->data);
101 |
102 | }
103 |
104 | /**
105 | * Show the form for editing the specified resource.
106 | *
107 | * @param int $id
108 | * @return \Illuminate\Http\Response
109 | */
110 | public function edit($id)
111 | {
112 | $user = Auth::user();
113 |
114 | $result = App::whereUserId($user->id)->whereId($id)->first();
115 |
116 | if (!$result) {
117 | return back()->with('error', 'Record Not Found');
118 | }
119 |
120 | $this->data['Title'] = 'Edit App';
121 | $this->data['App'] = $result;
122 |
123 | return view('app-edit', $this->data);
124 | }
125 |
126 | /**
127 | * Update the specified resource in storage.
128 | *
129 | * @param \Illuminate\Http\Request $request
130 | * @param int $id
131 | * @return \Illuminate\Http\Response
132 | */
133 | public function update(Request $request)
134 | {
135 | $user = $request->user();
136 |
137 | $fieldsToValidate = [
138 | 'id' => 'required|integer',
139 | 'name' => 'required|string|max:50',
140 | 'description' => 'required|string|max:180',
141 | 'domain' => 'required|url'
142 | ];
143 |
144 | $request->validate($fieldsToValidate);
145 |
146 | $app = App::whereUserId($user->id)->whereId($request->id)->first();
147 |
148 | if (!$app) {
149 | return back()->with('error', 'Record Not Found');
150 | }
151 |
152 | $app->user_id = $user->id;
153 | $app->name = $request->name;
154 | $app->description = $request->description;
155 | $app->domain = $request->domain;
156 | $app->updated_by = $user->id;
157 | $app->save();
158 |
159 | return redirect('app/show/' . $app->id)->with('success', "App Has Been Updated!");
160 | }
161 |
162 | /**
163 | * Remove the specified resource from storage.
164 | *
165 | * @param int $id
166 | * @return \Illuminate\Http\Response
167 | */
168 | public function destroy($id)
169 | {
170 | $user = Auth::user();
171 |
172 | $result = App::whereUserId($user->id)->whereId($id)->first();
173 |
174 | if (!$result) {
175 | return back()->with('error', 'Record Not Found');
176 | }
177 |
178 | $result->delete();
179 |
180 | return redirect('app')->with('success', 'App Has Been Deleted!');
181 | }
182 | }
183 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/ForgotPasswordController.php:
--------------------------------------------------------------------------------
1 | middleware('guest');
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/LoginController.php:
--------------------------------------------------------------------------------
1 | middleware('guest')->except('logout');
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/RegisterController.php:
--------------------------------------------------------------------------------
1 | middleware('guest');
41 | }
42 |
43 | /**
44 | * Get a validator for an incoming registration request.
45 | *
46 | * @param array $data
47 | * @return \Illuminate\Contracts\Validation\Validator
48 | */
49 | protected function validator(array $data)
50 | {
51 | return Validator::make($data, [
52 | 'name' => ['required', 'string', 'max:255'],
53 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
54 | 'password' => ['required', 'string', 'min:8', 'confirmed'],
55 | ]);
56 | }
57 |
58 | /**
59 | * Create a new user instance after a valid registration.
60 | *
61 | * @param array $data
62 | * @return \App\User
63 | */
64 | protected function create(array $data)
65 | {
66 | return User::create([
67 | 'name' => $data['name'],
68 | 'email' => $data['email'],
69 | 'password' => Hash::make($data['password']),
70 | ]);
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/ResetPasswordController.php:
--------------------------------------------------------------------------------
1 | middleware('guest');
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/VerificationController.php:
--------------------------------------------------------------------------------
1 | middleware('auth');
38 | $this->middleware('signed')->only('verify');
39 | $this->middleware('throttle:6,1')->only('verify', 'resend');
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/Http/Controllers/CodeController.php:
--------------------------------------------------------------------------------
1 | middleware(['auth', 'verified']);
14 | }
15 |
16 | /**
17 | * Display a listing of the resource.
18 | *
19 | * @return \Illuminate\Http\Response
20 | */
21 | public function index(Request $request)
22 | {
23 | $user = $request->user();
24 |
25 | $this->data['Title'] = 'List Codes';
26 |
27 | $this->data['App'] = App::whereUserId($user->id)->whereId($request->id)->first();
28 |
29 | if (!$this->data['App']) {
30 | return back()->with('error', 'Record Not Found');
31 | }
32 |
33 | return view('list-code', $this->data);
34 |
35 | }
36 |
37 | /**
38 | * Show the form for creating a new resource.
39 | *
40 | * @return \Illuminate\Http\Response
41 | */
42 | public function create()
43 | {
44 | //
45 | }
46 |
47 | /**
48 | * Store a newly created resource in storage.
49 | *
50 | * @param \Illuminate\Http\Request $request
51 | * @return \Illuminate\Http\Response
52 | */
53 | public function store(Request $request)
54 | {
55 | //
56 | }
57 |
58 | /**
59 | * Display the specified resource.
60 | *
61 | * @param int $id
62 | * @return \Illuminate\Http\Response
63 | */
64 | public function show($id)
65 | {
66 |
67 | $this->data['Title'] = 'View Code';
68 |
69 | $code = Code::find($id);
70 |
71 | if (!$code) {
72 | return back()->with('success', 'Record Not Found');
73 | }
74 |
75 | $this->data['Code'] = $code;
76 |
77 | return view('code.show', $this->data);
78 |
79 |
80 | }
81 |
82 | /**
83 | * Show the form for editing the specified resource.
84 | *
85 | * @param int $id
86 | * @return \Illuminate\Http\Response
87 | */
88 | public function edit($id)
89 | {
90 | $this->data['Title'] = 'Edit Code';
91 |
92 | $code = Code::find($id);
93 |
94 | if (!$code) {
95 | return back()->with('success', 'Record Not Found');
96 | }
97 |
98 | $this->data['Code'] = $code;
99 |
100 | return view('code.edit', $this->data);
101 | }
102 |
103 | /**
104 | * Update the specified resource in storage.
105 | *
106 | * @param \Illuminate\Http\Request $request
107 | * @param int $id
108 | * @return \Illuminate\Http\Response
109 | */
110 | public function update(Request $request)
111 | {
112 | $user = $request->user();
113 |
114 | $fieldsToValidate = [
115 | 'url' => 'required|url',
116 | 'name' => 'required|string|max:50',
117 | ];
118 |
119 | $request->validate($fieldsToValidate);
120 |
121 | $code = Code::find($request->id);
122 | $code->url = $request->url;
123 | $code->name = $request->name;
124 | $code->save();
125 |
126 | return back()->with('success','Record Has Been Updated!');
127 | }
128 |
129 | /**
130 | * Remove the specified resource from storage.
131 | *
132 | * @param int $id
133 | * @return \Illuminate\Http\Response
134 | */
135 | public function destroy($id)
136 | {
137 | //
138 | }
139 | }
140 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Controller.php:
--------------------------------------------------------------------------------
1 | middleware(['auth', 'verified']);
13 | }
14 |
15 | /**
16 | * Display a listing of the resource.
17 | *
18 | * @return \Illuminate\Http\Response
19 | */
20 | public function index(Request $request)
21 | {
22 | $this->data['Title'] = 'Feedback';
23 | $this->data['Feedback'] = Feedback::orderBy('id', 'desc')->get();
24 | return view('feedback.index', $this->data);
25 |
26 | }
27 |
28 | /**
29 | * Show the form for creating a new resource.
30 | *
31 | * @return \Illuminate\Http\Response
32 | */
33 | public function create(Request $request)
34 | {
35 | $this->data['Title'] = 'Give Feedback';
36 |
37 | return view('feedback.create', $this->data);
38 | }
39 |
40 | /**
41 | * Store a newly created resource in storage.
42 | *
43 | * @param \Illuminate\Http\Request $request
44 | * @return \Illuminate\Http\Response
45 | */
46 | public function store(Request $request)
47 | {
48 | $user = $request->user();
49 |
50 | $fieldsToValidate = [
51 | 'subject' => 'required|string|max:50',
52 | 'message' => 'required|string|max:255',
53 | ];
54 |
55 | $request->validate($fieldsToValidate);
56 |
57 | $feedback = new Feedback();
58 | $feedback->user_id = $user->id;
59 | $feedback->subject = $request->subject;
60 | $feedback->message = $request->message;
61 | $feedback->save();
62 |
63 | return back()->with('success', "Thanks for your feedback!");
64 | }
65 |
66 | /**
67 | * Display the specified resource.
68 | *
69 | * @param int $id
70 | * @return \Illuminate\Http\Response
71 | */
72 | public function show($id)
73 | {
74 | //
75 | }
76 |
77 | /**
78 | * Show the form for editing the specified resource.
79 | *
80 | * @param int $id
81 | * @return \Illuminate\Http\Response
82 | */
83 | public function edit($id)
84 | {
85 | //
86 | }
87 |
88 | /**
89 | * Update the specified resource in storage.
90 | *
91 | * @param \Illuminate\Http\Request $request
92 | * @param int $id
93 | * @return \Illuminate\Http\Response
94 | */
95 | public function update(Request $request, $id)
96 | {
97 | //
98 | }
99 |
100 | /**
101 | * Remove the specified resource from storage.
102 | *
103 | * @param int $id
104 | * @return \Illuminate\Http\Response
105 | */
106 | public function destroy($id)
107 | {
108 | //
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/app/Http/Controllers/GuestController.php:
--------------------------------------------------------------------------------
1 | code_id = $q->id;
20 | $v->ip = $location['ip'];
21 | $v->city = $location['city'];
22 | $v->region = $location['region'];
23 | $v->country = $location['country'];
24 | $v->loc = $location['loc'];
25 | $v->postal = $location['postal'];
26 | $v->timezone = $location['timezone'];
27 | $v->save();
28 |
29 | return redirect($q->url);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/Http/Controllers/HomeController.php:
--------------------------------------------------------------------------------
1 | middleware(['auth', 'verified']);
20 | }
21 |
22 | /**
23 | * Show the application dashboard.
24 | *
25 | * @return \Illuminate\Contracts\Support\Renderable
26 | */
27 | public function index(Request $request)
28 | {
29 | $user = $request->user();
30 |
31 | $app = new App();
32 |
33 | if ($user->user_type == 2) {
34 | $app = $app->whereUserId($user->id);
35 | }
36 |
37 | $this->data['Title'] = 'Home';
38 | $this->data['TotalApps'] = $app->count();
39 |
40 | $codes = 0;
41 |
42 | foreach ($app->get() as $key) {
43 | $codes += $key->codes->count();
44 | }
45 |
46 | $this->data['TotalCodes'] = $codes;
47 |
48 | if ($user->user_type == 1) {
49 | $this->data['TotalUsers'] = User::whereUserType(2)->count();
50 | }
51 |
52 | return view('home', $this->data);
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/app/Http/Controllers/PasswordController.php:
--------------------------------------------------------------------------------
1 | middleware(['auth', 'verified']);
18 | }
19 |
20 | /**
21 | * Display a listing of the resource.
22 | *
23 | * @return \Illuminate\Http\Response
24 | */
25 | public function index()
26 | {
27 | //
28 | }
29 |
30 | /**
31 | * Show the form for creating a new resource.
32 | *
33 | * @return \Illuminate\Http\Response
34 | */
35 | public function create()
36 | {
37 | $this->data['Title'] = 'Change Password';
38 | return view('change-password', $this->data);
39 | }
40 |
41 | /**
42 | * Store a newly created resource in storage.
43 | *
44 | * @param \Illuminate\Http\Request $request
45 | * @return \Illuminate\Http\Response
46 | */
47 | public function store(Request $request)
48 | {
49 | //
50 | }
51 |
52 | /**
53 | * Display the specified resource.
54 | *
55 | * @param int $id
56 | * @return \Illuminate\Http\Response
57 | */
58 | public function show($id)
59 | {
60 | //
61 | }
62 |
63 | /**
64 | * Show the form for editing the specified resource.
65 | *
66 | * @param int $id
67 | * @return \Illuminate\Http\Response
68 | */
69 | public function edit($id)
70 | {
71 | //
72 | }
73 |
74 | /**
75 | * Update the specified resource in storage.
76 | *
77 | * @param \Illuminate\Http\Request $request
78 | * @param int $id
79 | * @return \Illuminate\Http\Response
80 | */
81 | public function update(Request $request)
82 | {
83 |
84 | $fieldsToValidate = [
85 | 'password' => ['required', 'string', 'min:8', 'confirmed'],
86 | ];
87 |
88 | $request->validate($fieldsToValidate);
89 |
90 | $user = $request->user();
91 | $user->password = bcrypt($request->password);
92 | $user->save();
93 |
94 | return redirect('home')->with('success', 'Your Password Has Been Changed!');
95 |
96 | }
97 |
98 | /**
99 | * Remove the specified resource from storage.
100 | *
101 | * @param int $id
102 | * @return \Illuminate\Http\Response
103 | */
104 | public function destroy($id)
105 | {
106 | //
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/app/Http/Controllers/VisitorController.php:
--------------------------------------------------------------------------------
1 | middleware(['auth', 'verified']);
14 | }
15 |
16 | /**
17 | * Display a listing of the resource.
18 | *
19 | * @return \Illuminate\Http\Response
20 | */
21 | public function index(Request $request)
22 | {
23 | $this->data['Title'] = 'Visitors';
24 | $this->data['Visitors'] = Visitor::whereCodeId($request->code_id)->orderBy('id', 'desc')->get();
25 | return view('visitor.index', $this->data);
26 | }
27 |
28 | /**
29 | * Show the form for creating a new resource.
30 | *
31 | * @return \Illuminate\Http\Response
32 | */
33 | public function create()
34 | {
35 | //
36 | }
37 |
38 | /**
39 | * Store a newly created resource in storage.
40 | *
41 | * @param \Illuminate\Http\Request $request
42 | * @return \Illuminate\Http\Response
43 | */
44 | public function store(Request $request)
45 | {
46 | //
47 | }
48 |
49 | /**
50 | * Display the specified resource.
51 | *
52 | * @param int $id
53 | * @return \Illuminate\Http\Response
54 | */
55 | public function show($id)
56 | {
57 | //
58 | }
59 |
60 | /**
61 | * Show the form for editing the specified resource.
62 | *
63 | * @param int $id
64 | * @return \Illuminate\Http\Response
65 | */
66 | public function edit($id)
67 | {
68 | //
69 | }
70 |
71 | /**
72 | * Update the specified resource in storage.
73 | *
74 | * @param \Illuminate\Http\Request $request
75 | * @param int $id
76 | * @return \Illuminate\Http\Response
77 | */
78 | public function update(Request $request, $id)
79 | {
80 | //
81 | }
82 |
83 | /**
84 | * Remove the specified resource from storage.
85 | *
86 | * @param int $id
87 | * @return \Illuminate\Http\Response
88 | */
89 | public function destroy($id)
90 | {
91 | //
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/app/Http/Kernel.php:
--------------------------------------------------------------------------------
1 | [
33 | \App\Http\Middleware\EncryptCookies::class,
34 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
35 | \Illuminate\Session\Middleware\StartSession::class,
36 | // \Illuminate\Session\Middleware\AuthenticateSession::class,
37 | \Illuminate\View\Middleware\ShareErrorsFromSession::class,
38 | \App\Http\Middleware\VerifyCsrfToken::class,
39 | \Illuminate\Routing\Middleware\SubstituteBindings::class,
40 | ],
41 | 'is_admin_group' => [
42 | 'is_admin' => \App\Http\Middleware\IsAdmin::class,
43 | ],
44 | 'is_user_group' => [
45 | 'is_user' => \App\Http\Middleware\IsUser::class,
46 | ],
47 | 'api' => [
48 | 'throttle:60,1',
49 | 'bindings',
50 | ],
51 | ];
52 |
53 | /**
54 | * The application's route middleware.
55 | *
56 | * These middleware may be assigned to groups or used individually.
57 | *
58 | * @var array
59 | */
60 | protected $routeMiddleware = [
61 | 'auth' => \App\Http\Middleware\Authenticate::class,
62 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
63 | 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
64 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
65 | 'can' => \Illuminate\Auth\Middleware\Authorize::class,
66 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
67 | 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
68 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
69 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
70 | 'is_admin' => \App\Http\Middleware\IsAdmin::class,
71 | 'is_user' => \App\Http\Middleware\IsUser::class,
72 | 'cors' => \App\Http\Middleware\Cors::class,
73 | ];
74 |
75 | /**
76 | * The priority-sorted list of middleware.
77 | *
78 | * This forces non-global middleware to always be in the given order.
79 | *
80 | * @var array
81 | */
82 | protected $middlewarePriority = [
83 | \Illuminate\Session\Middleware\StartSession::class,
84 | \Illuminate\View\Middleware\ShareErrorsFromSession::class,
85 | \App\Http\Middleware\Authenticate::class,
86 | \Illuminate\Routing\Middleware\ThrottleRequests::class,
87 | \Illuminate\Session\Middleware\AuthenticateSession::class,
88 | \Illuminate\Routing\Middleware\SubstituteBindings::class,
89 | \Illuminate\Auth\Middleware\Authorize::class,
90 | ];
91 | }
92 |
--------------------------------------------------------------------------------
/app/Http/Middleware/Authenticate.php:
--------------------------------------------------------------------------------
1 | expectsJson()) {
18 | return route('login');
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/app/Http/Middleware/CheckForMaintenanceMode.php:
--------------------------------------------------------------------------------
1 | user_type != '1') {
26 | return redirect('/');
27 | }
28 |
29 | return $next($request);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/Http/Middleware/IsUser.php:
--------------------------------------------------------------------------------
1 | user_type != '2') {
26 | return redirect('/');
27 | }
28 |
29 | return $next($request);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/Http/Middleware/RedirectIfAuthenticated.php:
--------------------------------------------------------------------------------
1 | check()) {
21 | return redirect('/home');
22 | }
23 |
24 | return $next($request);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/Http/Middleware/TrimStrings.php:
--------------------------------------------------------------------------------
1 | belongsTo('App\Models\User', 'user_id');
21 | }
22 |
23 | public function codes()
24 | {
25 | return $this->hasMany('App\Models\Code', 'app_id')->orderBy('id','desc');
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/Models/Code.php:
--------------------------------------------------------------------------------
1 | belongsTo('App\Models\App', 'app_id');
25 | }
26 |
27 | public function visitors()
28 | {
29 | return $this->hasMany('App\Models\Visitor', 'code_id');
30 | }
31 |
32 | public function getVisitsAttribute()
33 | {
34 |
35 | return $this->visitors()->count();
36 | }
37 |
38 | public function getCodeAttribute($value)
39 | {
40 | return URL::to(Storage::url('codes/' . $this->id . '/' . $value));
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/app/Models/Feedback.php:
--------------------------------------------------------------------------------
1 | belongsTo('App\Models\Code', 'code_id');
19 | }
20 |
21 | public function getLocAttribute($value)
22 | {
23 | return explode(',', $value);
24 | }
25 |
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/app/Notifications/PasswordResetRequest.php:
--------------------------------------------------------------------------------
1 | token = $token;
24 | }
25 |
26 | /**
27 | * Get the notification's delivery channels.
28 | *
29 | * @param mixed $notifiable
30 | * @return array
31 | */
32 | public function via($notifiable)
33 | {
34 | return ['mail'];
35 | }
36 |
37 | /**
38 | * Get the mail representation of the notification.
39 | *
40 | * @param mixed $notifiable
41 | * @return \Illuminate\Notifications\Messages\MailMessage
42 | */
43 | public function toMail($notifiable)
44 | {
45 | $url = url('/api/password/find/'.$this->token);
46 | return (new MailMessage)
47 | ->line('You are receiving this email because we received a password reset request for your account.')
48 | ->action('Reset Password', url($url))
49 | ->line('If you did not request a password reset, no further action is required.');
50 | }
51 |
52 | /**
53 | * Get the array representation of the notification.
54 | *
55 | * @param mixed $notifiable
56 | * @return array
57 | */
58 | public function toArray($notifiable)
59 | {
60 | return [
61 | //
62 | ];
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/app/Notifications/PasswordResetSuccess.php:
--------------------------------------------------------------------------------
1 | line('You are changed your password succeful.')
45 | ->line('If you did change password, no further action is required.')
46 | ->line('If you did not change password, protect your account.');
47 | }
48 |
49 | /**
50 | * Get the array representation of the notification.
51 | *
52 | * @param mixed $notifiable
53 | * @return array
54 | */
55 | public function toArray($notifiable)
56 | {
57 | return [
58 | //
59 | ];
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/app/Notifications/SignupActivate.php:
--------------------------------------------------------------------------------
1 | activation_token);
44 | return (new MailMessage)
45 | ->subject('Confirm your account')
46 | ->line('Thanks for signup! Please before you begin, you must confirm your account.')
47 | ->action('Confirm Account', url($url))
48 | ->line('Thank you for using our application!');
49 | }
50 |
51 | /**
52 | * Get the array representation of the notification.
53 | *
54 | * @param mixed $notifiable
55 | * @return array
56 | */
57 | public function toArray($notifiable)
58 | {
59 | return [
60 | //
61 | ];
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/app/Providers/AppServiceProvider.php:
--------------------------------------------------------------------------------
1 | 'App\Policies\ModelPolicy',
17 | ];
18 |
19 | /**
20 | * Register any authentication / authorization services.
21 | *
22 | * @return void
23 | */
24 | public function boot()
25 | {
26 | $this->registerPolicies();
27 |
28 | //
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/Providers/BroadcastServiceProvider.php:
--------------------------------------------------------------------------------
1 | [
19 | SendEmailVerificationNotification::class,
20 | ],
21 | ];
22 |
23 | /**
24 | * Register any events for your application.
25 | *
26 | * @return void
27 | */
28 | public function boot()
29 | {
30 | parent::boot();
31 |
32 | //
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/Providers/RouteServiceProvider.php:
--------------------------------------------------------------------------------
1 | mapApiRoutes();
39 |
40 | $this->mapWebRoutes();
41 |
42 | //
43 | }
44 |
45 | /**
46 | * Define the "web" routes for the application.
47 | *
48 | * These routes all receive session state, CSRF protection, etc.
49 | *
50 | * @return void
51 | */
52 | protected function mapWebRoutes()
53 | {
54 | Route::middleware('web')
55 | ->namespace($this->namespace)
56 | ->group(base_path('routes/web.php'));
57 | }
58 |
59 | /**
60 | * Define the "api" routes for the application.
61 | *
62 | * These routes are typically stateless.
63 | *
64 | * @return void
65 | */
66 | protected function mapApiRoutes()
67 | {
68 | Route::prefix('api')
69 | ->middleware('api')
70 | ->namespace($this->namespace)
71 | ->group(base_path('routes/api.php'));
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/app/Rules/VerifyAppCodeId.php:
--------------------------------------------------------------------------------
1 | appKey = $appKey;
20 | $this->secretKey = $secretKey;
21 | }
22 |
23 | /**
24 | * Determine if the validation rule passes.
25 | *
26 | * @param string $attribute
27 | * @param mixed $value
28 | * @return bool
29 | */
30 | public function passes($attribute, $value)
31 | {
32 | $result['app'] = App::whereAppKey($this->appKey)
33 | ->whereSecretKey($this->secretKey)
34 | ->whereHas('codes',function($q) use ($value){
35 | return $q->whereId($value);
36 | })
37 | ->first();
38 |
39 | if(!$result['app']){
40 | return false;
41 | }
42 |
43 | return true;
44 |
45 | }
46 |
47 | /**
48 | * Get the validation error message.
49 | *
50 | * @return string
51 | */
52 | public function message()
53 | {
54 | return 'Please provide valid :attribute';
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/app/Rules/VerifyAppSecretKey.php:
--------------------------------------------------------------------------------
1 | appKey = $appKey;
19 | }
20 |
21 | /**
22 | * Determine if the validation rule passes.
23 | *
24 | * @param string $attribute
25 | * @param mixed $value
26 | * @return bool
27 | */
28 | public function passes($attribute, $value)
29 | {
30 | $result = App::whereAppKey($this->appKey)->whereSecretKey($value)->first();
31 |
32 | return ($result);
33 | }
34 |
35 | /**
36 | * Get the validation error message.
37 | *
38 | * @return string
39 | */
40 | public function message()
41 | {
42 | return 'Please provide valid :attribute';
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/app/User.php:
--------------------------------------------------------------------------------
1 | 'datetime',
45 | ];
46 |
47 | public function app()
48 | {
49 | return $this->hasMany('App\Models\App', 'user_id');
50 | }
51 |
52 | public function getAvatarAttribute($value)
53 | {
54 | return URL::to(Storage::url('avatars/' . $this->id . '/' . $value));
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/artisan:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env php
2 | make(Illuminate\Contracts\Console\Kernel::class);
34 |
35 | $status = $kernel->handle(
36 | $input = new Symfony\Component\Console\Input\ArgvInput,
37 | new Symfony\Component\Console\Output\ConsoleOutput
38 | );
39 |
40 | /*
41 | |--------------------------------------------------------------------------
42 | | Shutdown The Application
43 | |--------------------------------------------------------------------------
44 | |
45 | | Once Artisan has finished running, we will fire off the shutdown events
46 | | so that any final work may be done by the application before we shut
47 | | down the process. This is the last thing to happen to the request.
48 | |
49 | */
50 |
51 | $kernel->terminate($input, $status);
52 |
53 | exit($status);
54 |
--------------------------------------------------------------------------------
/bootstrap/app.php:
--------------------------------------------------------------------------------
1 | singleton(
30 | Illuminate\Contracts\Http\Kernel::class,
31 | App\Http\Kernel::class
32 | );
33 |
34 | $app->singleton(
35 | Illuminate\Contracts\Console\Kernel::class,
36 | App\Console\Kernel::class
37 | );
38 |
39 | $app->singleton(
40 | Illuminate\Contracts\Debug\ExceptionHandler::class,
41 | App\Exceptions\Handler::class
42 | );
43 |
44 | /*
45 | |--------------------------------------------------------------------------
46 | | Return The Application
47 | |--------------------------------------------------------------------------
48 | |
49 | | This script returns the application instance. The instance is given to
50 | | the calling script so we can separate the building of the instances
51 | | from the actual running of the application and sending responses.
52 | |
53 | */
54 |
55 | return $app;
56 |
--------------------------------------------------------------------------------
/bootstrap/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "laravel/laravel",
3 | "type": "project",
4 | "description": "The Laravel Framework.",
5 | "keywords": [
6 | "framework",
7 | "laravel"
8 | ],
9 | "license": "MIT",
10 | "require": {
11 | "php": "^7.2",
12 | "barryvdh/laravel-cors": "^1.0",
13 | "fideloper/proxy": "^4.0",
14 | "fruitcake/laravel-cors": "^1.0",
15 | "laravel/framework": "^6.0",
16 | "laravel/passport": "^7.5",
17 | "laravel/tinker": "^1.0",
18 | "laravel/ui": "^1.1",
19 | "laravolt/avatar": "^3.0",
20 | "simplesoftwareio/simple-qrcode": "~2"
21 | },
22 | "require-dev": {
23 | "facade/ignition": "^1.4",
24 | "fzaninotto/faker": "^1.4",
25 | "mockery/mockery": "^1.0",
26 | "nunomaduro/collision": "^3.0",
27 | "phpunit/phpunit": "^8.0"
28 | },
29 | "config": {
30 | "optimize-autoloader": true,
31 | "preferred-install": "dist",
32 | "sort-packages": true
33 | },
34 | "extra": {
35 | "laravel": {
36 | "dont-discover": []
37 | }
38 | },
39 | "autoload": {
40 | "psr-4": {
41 | "App\\": "app/"
42 | },
43 | "classmap": [
44 | "database/seeds",
45 | "database/factories"
46 | ]
47 | },
48 | "autoload-dev": {
49 | "psr-4": {
50 | "Tests\\": "tests/"
51 | }
52 | },
53 | "minimum-stability": "dev",
54 | "prefer-stable": true,
55 | "scripts": {
56 | "post-autoload-dump": [
57 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
58 | "@php artisan package:discover --ansi"
59 | ],
60 | "post-root-package-install": [
61 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
62 | ],
63 | "post-create-project-cmd": [
64 | "@php artisan key:generate --ansi"
65 | ]
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/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' => 'UTC',
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' => 'en',
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 | SimpleSoftwareIO\QrCode\QrCodeServiceProvider::class,
169 |
170 | /*
171 | * Application Service Providers...
172 | */
173 | App\Providers\AppServiceProvider::class,
174 | App\Providers\AuthServiceProvider::class,
175 | // App\Providers\BroadcastServiceProvider::class,
176 | App\Providers\EventServiceProvider::class,
177 | App\Providers\RouteServiceProvider::class,
178 |
179 | ],
180 |
181 | /*
182 | |--------------------------------------------------------------------------
183 | | Class Aliases
184 | |--------------------------------------------------------------------------
185 | |
186 | | This array of class aliases will be registered when this application
187 | | is started. However, feel free to register as many as you wish as
188 | | the aliases are "lazy" loaded so they don't hinder performance.
189 | |
190 | */
191 |
192 | 'aliases' => [
193 |
194 | 'App' => Illuminate\Support\Facades\App::class,
195 | 'Arr' => Illuminate\Support\Arr::class,
196 | 'Artisan' => Illuminate\Support\Facades\Artisan::class,
197 | 'Auth' => Illuminate\Support\Facades\Auth::class,
198 | 'Blade' => Illuminate\Support\Facades\Blade::class,
199 | 'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
200 | 'Bus' => Illuminate\Support\Facades\Bus::class,
201 | 'Cache' => Illuminate\Support\Facades\Cache::class,
202 | 'Config' => Illuminate\Support\Facades\Config::class,
203 | 'Cookie' => Illuminate\Support\Facades\Cookie::class,
204 | 'Crypt' => Illuminate\Support\Facades\Crypt::class,
205 | 'DB' => Illuminate\Support\Facades\DB::class,
206 | 'Eloquent' => Illuminate\Database\Eloquent\Model::class,
207 | 'Event' => Illuminate\Support\Facades\Event::class,
208 | 'File' => Illuminate\Support\Facades\File::class,
209 | 'Gate' => Illuminate\Support\Facades\Gate::class,
210 | 'Hash' => Illuminate\Support\Facades\Hash::class,
211 | 'Lang' => Illuminate\Support\Facades\Lang::class,
212 | 'Log' => Illuminate\Support\Facades\Log::class,
213 | 'Mail' => Illuminate\Support\Facades\Mail::class,
214 | 'Notification' => Illuminate\Support\Facades\Notification::class,
215 | 'Password' => Illuminate\Support\Facades\Password::class,
216 | 'Queue' => Illuminate\Support\Facades\Queue::class,
217 | 'Redirect' => Illuminate\Support\Facades\Redirect::class,
218 | 'Redis' => Illuminate\Support\Facades\Redis::class,
219 | 'Request' => Illuminate\Support\Facades\Request::class,
220 | 'Response' => Illuminate\Support\Facades\Response::class,
221 | 'Route' => Illuminate\Support\Facades\Route::class,
222 | 'Schema' => Illuminate\Support\Facades\Schema::class,
223 | 'Session' => Illuminate\Support\Facades\Session::class,
224 | 'Storage' => Illuminate\Support\Facades\Storage::class,
225 | 'Str' => Illuminate\Support\Str::class,
226 | 'URL' => Illuminate\Support\Facades\URL::class,
227 | 'Validator' => Illuminate\Support\Facades\Validator::class,
228 | 'View' => Illuminate\Support\Facades\View::class,
229 | 'QrCode' => SimpleSoftwareIO\QrCode\Facades\QrCode::class,
230 | 'Helper' => App\Helpers\Helper::class,
231 |
232 | ],
233 |
234 | ];
235 |
--------------------------------------------------------------------------------
/config/auth.php:
--------------------------------------------------------------------------------
1 | [
17 | 'guard' => 'web',
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' => 'passport',
46 | 'provider' => 'users',
47 | ],
48 | ],
49 |
50 | /*
51 | |--------------------------------------------------------------------------
52 | | User Providers
53 | |--------------------------------------------------------------------------
54 | |
55 | | All authentication drivers have a user provider. This defines how the
56 | | users are actually retrieved out of your database or other storage
57 | | mechanisms used by this application to persist your user's data.
58 | |
59 | | If you have multiple user tables or models you may configure multiple
60 | | sources which represent each model / table. These sources may then
61 | | be assigned to any extra authentication guards you have defined.
62 | |
63 | | Supported: "database", "eloquent"
64 | |
65 | */
66 |
67 | 'providers' => [
68 | 'users' => [
69 | 'driver' => 'eloquent',
70 | 'model' => App\User::class,
71 | ],
72 |
73 | // 'users' => [
74 | // 'driver' => 'database',
75 | // 'table' => 'users',
76 | // ],
77 | ],
78 |
79 | /*
80 | |--------------------------------------------------------------------------
81 | | Resetting Passwords
82 | |--------------------------------------------------------------------------
83 | |
84 | | You may specify multiple password reset configurations if you have more
85 | | than one user table or model in the application and you want to have
86 | | separate password reset settings based on the specific user types.
87 | |
88 | | The expire time is the number of minutes that the reset token should be
89 | | considered valid. This security feature keeps tokens short-lived so
90 | | they have less time to be guessed. You may change this as needed.
91 | |
92 | */
93 |
94 | 'passwords' => [
95 | 'users' => [
96 | 'provider' => 'users',
97 | 'table' => 'password_resets',
98 | 'expire' => 60,
99 | ],
100 | ],
101 |
102 | ];
103 |
--------------------------------------------------------------------------------
/config/broadcasting.php:
--------------------------------------------------------------------------------
1 | env('BROADCAST_DRIVER', 'null'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Broadcast Connections
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may define all of the broadcast connections that will be used
26 | | to broadcast events to other systems or over websockets. Samples of
27 | | each available type of connection are provided inside this array.
28 | |
29 | */
30 |
31 | 'connections' => [
32 |
33 | 'pusher' => [
34 | 'driver' => 'pusher',
35 | 'key' => env('PUSHER_APP_KEY'),
36 | 'secret' => env('PUSHER_APP_SECRET'),
37 | 'app_id' => env('PUSHER_APP_ID'),
38 | 'options' => [
39 | 'cluster' => env('PUSHER_APP_CLUSTER'),
40 | 'useTLS' => true,
41 | ],
42 | ],
43 |
44 | 'redis' => [
45 | 'driver' => 'redis',
46 | 'connection' => 'default',
47 | ],
48 |
49 | 'log' => [
50 | 'driver' => 'log',
51 | ],
52 |
53 | 'null' => [
54 | 'driver' => 'null',
55 | ],
56 |
57 | ],
58 |
59 | ];
60 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/config/cors.php:
--------------------------------------------------------------------------------
1 | ['api/*'],
25 |
26 | /*
27 | * Matches the request method. `[*]` allows all methods.
28 | */
29 | 'allowed_methods' => ['*'],
30 |
31 | /*
32 | * Matches the request origin. `[*]` allows all origins.
33 | */
34 | 'allowed_origins' => ['*'],
35 |
36 | /*
37 | * Matches the request origin with, similar to `Request::is()`
38 | */
39 | 'allowed_origins_patterns' => [],
40 |
41 | /*
42 | * Sets the Access-Control-Allow-Headers response header. `[*]` allows all headers.
43 | */
44 | 'allowed_headers' => ['*'],
45 |
46 | /*
47 | * Sets the Access-Control-Expose-Headers response header.
48 | */
49 | 'exposed_headers' => false,
50 |
51 | /*
52 | * Sets the Access-Control-Max-Age response header.
53 | */
54 | 'max_age' => false,
55 |
56 | /*
57 | * Sets the Access-Control-Allow-Credentials header.
58 | */
59 | 'supports_credentials' => false,
60 | ];
61 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/config/filesystems.php:
--------------------------------------------------------------------------------
1 | env('FILESYSTEM_DRIVER', 'local'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Default Cloud Filesystem Disk
21 | |--------------------------------------------------------------------------
22 | |
23 | | Many applications store files both locally and in the cloud. For this
24 | | reason, you may specify a default "cloud" driver here. This driver
25 | | will be bound as the Cloud disk implementation in the container.
26 | |
27 | */
28 |
29 | 'cloud' => env('FILESYSTEM_CLOUD', 's3'),
30 |
31 | /*
32 | |--------------------------------------------------------------------------
33 | | Filesystem Disks
34 | |--------------------------------------------------------------------------
35 | |
36 | | Here you may configure as many filesystem "disks" as you wish, and you
37 | | may even configure multiple disks of the same driver. Defaults have
38 | | been setup for each driver as an example of the required options.
39 | |
40 | | Supported Drivers: "local", "ftp", "sftp", "s3"
41 | |
42 | */
43 |
44 | 'disks' => [
45 |
46 | 'local' => [
47 | 'driver' => 'local',
48 | 'root' => storage_path('app'),
49 | ],
50 |
51 | 'public' => [
52 | 'driver' => 'local',
53 | 'root' => storage_path('app/public'),
54 | 'url' => env('APP_URL').'/storage',
55 | 'visibility' => 'public',
56 | ],
57 |
58 | 's3' => [
59 | 'driver' => 's3',
60 | 'key' => env('AWS_ACCESS_KEY_ID'),
61 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
62 | 'region' => env('AWS_DEFAULT_REGION'),
63 | 'bucket' => env('AWS_BUCKET'),
64 | 'url' => env('AWS_URL'),
65 | ],
66 |
67 | ],
68 |
69 | ];
70 |
--------------------------------------------------------------------------------
/config/hashing.php:
--------------------------------------------------------------------------------
1 | 'bcrypt',
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Bcrypt Options
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may specify the configuration options that should be used when
26 | | passwords are hashed using the Bcrypt algorithm. This will allow you
27 | | to control the amount of time it takes to hash the given password.
28 | |
29 | */
30 |
31 | 'bcrypt' => [
32 | 'rounds' => env('BCRYPT_ROUNDS', 10),
33 | ],
34 |
35 | /*
36 | |--------------------------------------------------------------------------
37 | | Argon Options
38 | |--------------------------------------------------------------------------
39 | |
40 | | Here you may specify the configuration options that should be used when
41 | | passwords are hashed using the Argon algorithm. These will allow you
42 | | to control the amount of time it takes to hash the given password.
43 | |
44 | */
45 |
46 | 'argon' => [
47 | 'memory' => 1024,
48 | 'threads' => 2,
49 | 'time' => 2,
50 | ],
51 |
52 | ];
53 |
--------------------------------------------------------------------------------
/config/laravolt/avatar.php:
--------------------------------------------------------------------------------
1 | 'gd',
20 |
21 | // Initial generator class
22 | 'generator' => \Laravolt\Avatar\Generator\DefaultGenerator::class,
23 |
24 | // Theme implementation
25 | 'decorator' => \Laravolt\Avatar\Theme\Decorator::class,
26 |
27 | // Whether all characters supplied must be replaced with their closest ASCII counterparts
28 | 'ascii' => false,
29 |
30 | // Image shape: circle or square
31 | 'shape' => 'circle',
32 |
33 | // Image width, in pixel
34 | 'width' => 100,
35 |
36 | // Image height, in pixel
37 | 'height' => 100,
38 |
39 | // Number of characters used as initials. If name consists of single word, the first N character will be used
40 | 'chars' => 2,
41 |
42 | // font size
43 | 'fontSize' => 48,
44 |
45 | // convert initial letter in uppercase
46 | 'uppercase' => false,
47 |
48 | // Fonts used to render text.
49 | // If contains more than one fonts, randomly selected based on name supplied
50 | 'fonts' => [__DIR__.'/../fonts/OpenSans-Bold.ttf', __DIR__.'/../fonts/rockwell.ttf'],
51 |
52 | // List of foreground colors to be used, randomly selected based on name supplied
53 | 'foregrounds' => [
54 | '#FFFFFF',
55 | ],
56 |
57 | // List of background colors to be used, randomly selected based on name supplied
58 | 'backgrounds' => [
59 | '#f44336',
60 | '#E91E63',
61 | '#9C27B0',
62 | '#673AB7',
63 | '#3F51B5',
64 | '#2196F3',
65 | '#03A9F4',
66 | '#00BCD4',
67 | '#009688',
68 | '#4CAF50',
69 | '#8BC34A',
70 | '#CDDC39',
71 | '#FFC107',
72 | '#FF9800',
73 | '#FF5722',
74 | ],
75 |
76 | 'border' => [
77 | 'size' => 1,
78 |
79 | // border color, available value are:
80 | // 'foreground' (same as foreground color)
81 | // 'background' (same as background color)
82 | // or any valid hex ('#aabbcc')
83 | 'color' => 'background',
84 | ],
85 |
86 | // List of theme name to be used when rendering avatar
87 | // Possible values are:
88 | // 1. Theme name as string: 'colorful'
89 | // 2. Or array of string name: ['grayscale-light', 'grayscale-dark']
90 | // 3. Or wildcard "*" to use all defined themes
91 | 'theme' => ['*'],
92 |
93 | // Predefined themes
94 | // Available theme attributes are:
95 | // shape, chars, backgrounds, foregrounds, fonts, fontSize, width, height, ascii, uppercase, and border.
96 | 'themes' => [
97 | 'grayscale-light' => [
98 | 'backgrounds' => ['#edf2f7', '#e2e8f0', '#cbd5e0'],
99 | 'foregrounds' => ['#a0aec0'],
100 | ],
101 | 'grayscale-dark' => [
102 | 'backgrounds' => ['#2d3748', '#4a5568', '#718096'],
103 | 'foregrounds' => ['#e2e8f0'],
104 | ],
105 | 'colorful' => [
106 | 'backgrounds' => [
107 | '#f44336',
108 | '#E91E63',
109 | '#9C27B0',
110 | '#673AB7',
111 | '#3F51B5',
112 | '#2196F3',
113 | '#03A9F4',
114 | '#00BCD4',
115 | '#009688',
116 | '#4CAF50',
117 | '#8BC34A',
118 | '#CDDC39',
119 | '#FFC107',
120 | '#FF9800',
121 | '#FF5722',
122 | ],
123 | 'foregrounds' => ['#FFFFFF'],
124 | ],
125 | ]
126 | ];
127 |
--------------------------------------------------------------------------------
/config/logging.php:
--------------------------------------------------------------------------------
1 | env('LOG_CHANNEL', 'stack'),
21 |
22 | /*
23 | |--------------------------------------------------------------------------
24 | | Log Channels
25 | |--------------------------------------------------------------------------
26 | |
27 | | Here you may configure the log channels for your application. Out of
28 | | the box, Laravel uses the Monolog PHP logging library. This gives
29 | | you a variety of powerful log handlers / formatters to utilize.
30 | |
31 | | Available Drivers: "single", "daily", "slack", "syslog",
32 | | "errorlog", "monolog",
33 | | "custom", "stack"
34 | |
35 | */
36 |
37 | 'channels' => [
38 | 'stack' => [
39 | 'driver' => 'stack',
40 | 'channels' => ['daily'],
41 | 'ignore_exceptions' => false,
42 | ],
43 |
44 | 'single' => [
45 | 'driver' => 'single',
46 | 'path' => storage_path('logs/laravel.log'),
47 | 'level' => 'debug',
48 | ],
49 |
50 | 'daily' => [
51 | 'driver' => 'daily',
52 | 'path' => storage_path('logs/laravel.log'),
53 | 'level' => 'debug',
54 | 'days' => 14,
55 | ],
56 |
57 | 'slack' => [
58 | 'driver' => 'slack',
59 | 'url' => env('LOG_SLACK_WEBHOOK_URL'),
60 | 'username' => 'Laravel Log',
61 | 'emoji' => ':boom:',
62 | 'level' => 'critical',
63 | ],
64 |
65 | 'papertrail' => [
66 | 'driver' => 'monolog',
67 | 'level' => 'debug',
68 | 'handler' => SyslogUdpHandler::class,
69 | 'handler_with' => [
70 | 'host' => env('PAPERTRAIL_URL'),
71 | 'port' => env('PAPERTRAIL_PORT'),
72 | ],
73 | ],
74 |
75 | 'stderr' => [
76 | 'driver' => 'monolog',
77 | 'handler' => StreamHandler::class,
78 | 'formatter' => env('LOG_STDERR_FORMATTER'),
79 | 'with' => [
80 | 'stream' => 'php://stderr',
81 | ],
82 | ],
83 |
84 | 'syslog' => [
85 | 'driver' => 'syslog',
86 | 'level' => 'debug',
87 | ],
88 |
89 | 'errorlog' => [
90 | 'driver' => 'errorlog',
91 | 'level' => 'debug',
92 | ],
93 |
94 | 'null' => [
95 | 'driver' => 'monolog',
96 | 'handler' => NullHandler::class,
97 | ],
98 | ],
99 |
100 | ];
101 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/config/queue.php:
--------------------------------------------------------------------------------
1 | env('QUEUE_CONNECTION', 'sync'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Queue Connections
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here you may configure the connection information for each server that
24 | | is used by your application. A default configuration has been added
25 | | for each back-end shipped with Laravel. You are free to add more.
26 | |
27 | | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
28 | |
29 | */
30 |
31 | 'connections' => [
32 |
33 | 'sync' => [
34 | 'driver' => 'sync',
35 | ],
36 |
37 | 'database' => [
38 | 'driver' => 'database',
39 | 'table' => 'jobs',
40 | 'queue' => 'default',
41 | 'retry_after' => 90,
42 | ],
43 |
44 | 'beanstalkd' => [
45 | 'driver' => 'beanstalkd',
46 | 'host' => 'localhost',
47 | 'queue' => 'default',
48 | 'retry_after' => 90,
49 | 'block_for' => 0,
50 | ],
51 |
52 | 'sqs' => [
53 | 'driver' => 'sqs',
54 | 'key' => env('AWS_ACCESS_KEY_ID'),
55 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
56 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
57 | 'queue' => env('SQS_QUEUE', 'your-queue-name'),
58 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
59 | ],
60 |
61 | 'redis' => [
62 | 'driver' => 'redis',
63 | 'connection' => 'default',
64 | 'queue' => env('REDIS_QUEUE', 'default'),
65 | 'retry_after' => 90,
66 | 'block_for' => null,
67 | ],
68 |
69 | ],
70 |
71 | /*
72 | |--------------------------------------------------------------------------
73 | | Failed Queue Jobs
74 | |--------------------------------------------------------------------------
75 | |
76 | | These options configure the behavior of failed queue job logging so you
77 | | can control which database and table are used to store the jobs that
78 | | have failed. You may change them to any database / table you wish.
79 | |
80 | */
81 |
82 | 'failed' => [
83 | 'driver' => env('QUEUE_FAILED_DRIVER', 'database'),
84 | 'database' => env('DB_CONNECTION', 'mysql'),
85 | 'table' => 'failed_jobs',
86 | ],
87 |
88 | ];
89 |
--------------------------------------------------------------------------------
/config/services.php:
--------------------------------------------------------------------------------
1 | [
18 | 'domain' => env('MAILGUN_DOMAIN'),
19 | 'secret' => env('MAILGUN_SECRET'),
20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
21 | ],
22 |
23 | 'postmark' => [
24 | 'token' => env('POSTMARK_TOKEN'),
25 | ],
26 |
27 | 'ses' => [
28 | 'key' => env('AWS_ACCESS_KEY_ID'),
29 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
30 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
31 | ],
32 |
33 | ];
34 |
--------------------------------------------------------------------------------
/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"
194 | |
195 | */
196 |
197 | 'same_site' => null,
198 |
199 | ];
200 |
--------------------------------------------------------------------------------
/config/view.php:
--------------------------------------------------------------------------------
1 | [
17 | resource_path('views'),
18 | ],
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Compiled View Path
23 | |--------------------------------------------------------------------------
24 | |
25 | | This option determines where all the compiled Blade templates will be
26 | | stored for your application. Typically, this is within the storage
27 | | directory. However, as usual, you are free to change this value.
28 | |
29 | */
30 |
31 | 'compiled' => env(
32 | 'VIEW_COMPILED_PATH',
33 | realpath(storage_path('framework/views'))
34 | ),
35 |
36 | ];
37 |
--------------------------------------------------------------------------------
/database/.gitignore:
--------------------------------------------------------------------------------
1 | *.sqlite
2 | *.sqlite-journal
3 |
--------------------------------------------------------------------------------
/database/factories/UserFactory.php:
--------------------------------------------------------------------------------
1 | define(User::class, function (Faker $faker) {
20 | return [
21 | 'name' => $faker->name,
22 | 'email' => $faker->unique()->safeEmail,
23 | 'email_verified_at' => now(),
24 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
25 | 'remember_token' => Str::random(10),
26 | ];
27 | });
28 |
--------------------------------------------------------------------------------
/database/migrations/2014_10_12_000000_create_users_table.php:
--------------------------------------------------------------------------------
1 | bigIncrements('id');
18 | $table->string('name');
19 | $table->string('email')->unique();
20 | $table->timestamp('email_verified_at')->nullable();
21 | $table->string('password');
22 | $table->rememberToken();
23 | $table->timestamps();
24 | });
25 | }
26 |
27 | /**
28 | * Reverse the migrations.
29 | *
30 | * @return void
31 | */
32 | public function down()
33 | {
34 | Schema::dropIfExists('users');
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/database/migrations/2014_10_12_100000_create_password_resets_table.php:
--------------------------------------------------------------------------------
1 | string('email')->index();
18 | $table->string('token');
19 | $table->timestamp('created_at')->nullable();
20 | });
21 | }
22 |
23 | /**
24 | * Reverse the migrations.
25 | *
26 | * @return void
27 | */
28 | public function down()
29 | {
30 | Schema::dropIfExists('password_resets');
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/database/migrations/2019_08_19_000000_create_failed_jobs_table.php:
--------------------------------------------------------------------------------
1 | bigIncrements('id');
18 | $table->text('connection');
19 | $table->text('queue');
20 | $table->longText('payload');
21 | $table->longText('exception');
22 | $table->timestamp('failed_at')->useCurrent();
23 | });
24 | }
25 |
26 | /**
27 | * Reverse the migrations.
28 | *
29 | * @return void
30 | */
31 | public function down()
32 | {
33 | Schema::dropIfExists('failed_jobs');
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/database/seeds/DatabaseSeeder.php:
--------------------------------------------------------------------------------
1 | call(UsersTableSeeder::class);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "scripts": {
4 | "dev": "npm run development",
5 | "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
6 | "watch": "npm run development -- --watch",
7 | "watch-poll": "npm run watch -- --watch-poll",
8 | "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
9 | "prod": "npm run production",
10 | "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
11 | },
12 | "devDependencies": {
13 | "axios": "^0.19",
14 | "bootstrap": "^4.0.0",
15 | "cross-env": "^5.1",
16 | "jquery": "^3.2",
17 | "laravel-mix": "^4.0.7",
18 | "lodash": "^4.17.13",
19 | "popper.js": "^1.12",
20 | "resolve-url-loader": "2.3.1",
21 | "sass": "^1.20.1",
22 | "sass-loader": "7.*",
23 | "vue": "^2.5.17",
24 | "vue-template-compiler": "^2.6.10"
25 | },
26 | "dependencies": {
27 | "datatables.net-bs4": "^1.10.20",
28 | "datatables.net-jqui": "^1.10.20"
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/phpunit.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 | ./tests/Unit
14 |
15 |
16 |
17 | ./tests/Feature
18 |
19 |
20 |
21 |
22 | ./app
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/public/.htaccess:
--------------------------------------------------------------------------------
1 |
2 |
3 | #Options -MultiViews -Indexes
4 |
5 |
6 | RewriteEngine On
7 |
8 | # Handle Authorization Header
9 | RewriteCond %{HTTP:Authorization} .
10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
11 |
12 | # Redirect Trailing Slashes If Not A Folder...
13 | RewriteCond %{REQUEST_FILENAME} !-d
14 | RewriteCond %{REQUEST_URI} (.+)/$
15 | RewriteRule ^ %1 [L,R=301]
16 |
17 | # Handle Front Controller...
18 | RewriteCond %{REQUEST_FILENAME} !-d
19 | RewriteCond %{REQUEST_FILENAME} !-f
20 | RewriteRule ^ index.php [L]
21 |
22 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzudic/SOA-Ultimate-QR-Code-Generator/0eb06e80a564127352609afca09ae606598f0b6e/public/favicon.ico
--------------------------------------------------------------------------------
/public/index.php:
--------------------------------------------------------------------------------
1 |
8 | */
9 |
10 | define('LARAVEL_START', microtime(true));
11 |
12 | /*
13 | |--------------------------------------------------------------------------
14 | | Register The Auto Loader
15 | |--------------------------------------------------------------------------
16 | |
17 | | Composer provides a convenient, automatically generated class loader for
18 | | our application. We just need to utilize it! We'll simply require it
19 | | into the script here so that we don't have to worry about manual
20 | | loading any of our classes later on. It feels great to relax.
21 | |
22 | */
23 |
24 | require __DIR__.'/../vendor/autoload.php';
25 |
26 | /*
27 | |--------------------------------------------------------------------------
28 | | Turn On The Lights
29 | |--------------------------------------------------------------------------
30 | |
31 | | We need to illuminate PHP development, so let us turn on the lights.
32 | | This bootstraps the framework and gets it ready for use, then it
33 | | will load up this application so that we can run it and send
34 | | the responses back to the browser and delight our users.
35 | |
36 | */
37 |
38 | $app = require_once __DIR__.'/../bootstrap/app.php';
39 |
40 | /*
41 | |--------------------------------------------------------------------------
42 | | Run The Application
43 | |--------------------------------------------------------------------------
44 | |
45 | | Once we have the application, we can handle the incoming request
46 | | through the kernel, and send the associated response back to
47 | | the client's browser allowing them to enjoy the creative
48 | | and wonderful application we have prepared for them.
49 | |
50 | */
51 |
52 | $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
53 |
54 | $response = $kernel->handle(
55 | $request = Illuminate\Http\Request::capture()
56 | );
57 |
58 | $response->send();
59 |
60 | $kernel->terminate($request, $response);
61 |
--------------------------------------------------------------------------------
/public/mix-manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "/js/app.js": "/js/app.js",
3 | "/css/app.css": "/css/app.css"
4 | }
5 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Disallow:
3 |
--------------------------------------------------------------------------------
/resources/js/app.js:
--------------------------------------------------------------------------------
1 | /**
2 | * First we will load all of this project's JavaScript dependencies which
3 | * includes Vue and other libraries. It is a great starting point when
4 | * building robust, powerful web applications using Vue and Laravel.
5 | */
6 |
7 | require('./bootstrap');
8 |
9 |
10 | window.Vue = require('vue');
11 |
12 | /**
13 | * The following block of code may be used to automatically register your
14 | * Vue components. It will recursively scan this directory for the Vue
15 | * components and automatically register them with their "basename".
16 | *
17 | * Eg. ./components/ExampleComponent.vue ->
18 | */
19 |
20 | // const files = require.context('./', true, /\.vue$/i)
21 | // files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default))
22 |
23 | Vue.component('example-component', require('./components/ExampleComponent.vue').default);
24 |
25 | /**
26 | * Next, we will create a fresh Vue application instance and attach it to
27 | * the page. Then, you may begin adding components to this application
28 | * or customize the JavaScript scaffolding to fit your unique needs.
29 | */
30 |
31 | const app = new Vue({
32 | el: '#app',
33 | });
34 |
35 |
36 |
--------------------------------------------------------------------------------
/resources/js/bootstrap.js:
--------------------------------------------------------------------------------
1 | window._ = require('lodash');
2 |
3 | /**
4 | * We'll load jQuery and the Bootstrap jQuery plugin which provides support
5 | * for JavaScript based Bootstrap features such as modals and tabs. This
6 | * code may be modified to fit the specific needs of your application.
7 | */
8 |
9 | try {
10 | window.Popper = require('popper.js').default;
11 |
12 | require('bootstrap');
13 | } catch (e) {}
14 |
15 | /**
16 | * We'll load the axios HTTP library which allows us to easily issue requests
17 | * to our Laravel back-end. This library automatically handles sending the
18 | * CSRF token as a header based on the value of the "XSRF" token cookie.
19 | */
20 |
21 | window.axios = require('axios');
22 |
23 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
24 |
25 | /**
26 | * Echo exposes an expressive API for subscribing to channels and listening
27 | * for events that are broadcast by Laravel. Echo and event broadcasting
28 | * allows your team to easily build robust real-time web applications.
29 | */
30 |
31 | // import Echo from 'laravel-echo';
32 |
33 | // window.Pusher = require('pusher-js');
34 |
35 | // window.Echo = new Echo({
36 | // broadcaster: 'pusher',
37 | // key: process.env.MIX_PUSHER_APP_KEY,
38 | // cluster: process.env.MIX_PUSHER_APP_CLUSTER,
39 | // encrypted: true
40 | // });
41 |
--------------------------------------------------------------------------------
/resources/js/components/ExampleComponent.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
Example Component
7 |
8 |
9 | I'm an example component.
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
24 |
--------------------------------------------------------------------------------
/resources/lang/en/auth.php:
--------------------------------------------------------------------------------
1 | 'These credentials do not match our records.',
17 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',
18 |
19 | ];
20 |
--------------------------------------------------------------------------------
/resources/lang/en/pagination.php:
--------------------------------------------------------------------------------
1 | '« Previous',
17 | 'next' => 'Next »',
18 |
19 | ];
20 |
--------------------------------------------------------------------------------
/resources/lang/en/passwords.php:
--------------------------------------------------------------------------------
1 | 'Your password has been reset!',
17 | 'sent' => 'We have e-mailed your password reset link!',
18 | 'token' => 'This password reset token is invalid.',
19 | 'user' => "We can't find a user with that e-mail address.",
20 |
21 | ];
22 |
--------------------------------------------------------------------------------
/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 | 'present' => 'The :attribute field must be present.',
97 | 'regex' => 'The :attribute format is invalid.',
98 | 'required' => 'The :attribute field is required.',
99 | 'required_if' => 'The :attribute field is required when :other is :value.',
100 | 'required_unless' => 'The :attribute field is required unless :other is in :values.',
101 | 'required_with' => 'The :attribute field is required when :values is present.',
102 | 'required_with_all' => 'The :attribute field is required when :values are present.',
103 | 'required_without' => 'The :attribute field is required when :values is not present.',
104 | 'required_without_all' => 'The :attribute field is required when none of :values are present.',
105 | 'same' => 'The :attribute and :other must match.',
106 | 'size' => [
107 | 'numeric' => 'The :attribute must be :size.',
108 | 'file' => 'The :attribute must be :size kilobytes.',
109 | 'string' => 'The :attribute must be :size characters.',
110 | 'array' => 'The :attribute must contain :size items.',
111 | ],
112 | 'starts_with' => 'The :attribute must start with one of the following: :values',
113 | 'string' => 'The :attribute must be a string.',
114 | 'timezone' => 'The :attribute must be a valid zone.',
115 | 'unique' => 'The :attribute has already been taken.',
116 | 'uploaded' => 'The :attribute failed to upload.',
117 | 'url' => 'The :attribute format is invalid.',
118 | 'uuid' => 'The :attribute must be a valid 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 |
150 | ];
151 |
--------------------------------------------------------------------------------
/resources/sass/_variables.scss:
--------------------------------------------------------------------------------
1 | // Body
2 | $body-bg: #f8fafc;
3 |
4 | // Typography
5 | $font-family-sans-serif: 'Nunito', sans-serif;
6 | $font-size-base: 0.9rem;
7 | $line-height-base: 1.6;
8 |
9 | // Colors
10 | $blue: #3490dc;
11 | $indigo: #6574cd;
12 | $purple: #9561e2;
13 | $pink: #f66d9b;
14 | $red: #e3342f;
15 | $orange: #f6993f;
16 | $yellow: #ffed4a;
17 | $green: #38c172;
18 | $teal: #4dc0b5;
19 | $cyan: #6cb2eb;
20 |
--------------------------------------------------------------------------------
/resources/sass/app.scss:
--------------------------------------------------------------------------------
1 | // Fonts
2 | @import url('https://fonts.googleapis.com/css?family=Nunito');
3 |
4 | // Variables
5 | @import 'variables';
6 |
7 | // Bootstrap
8 | @import '~bootstrap/scss/bootstrap';
9 |
--------------------------------------------------------------------------------
/resources/views/app-create.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 |
3 | @section('content')
4 |