Skip to content

Commit eb00927

Browse files
committed
ported to vijay goswami repository
0 parents  commit eb00927

File tree

1,029 files changed

+92273
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,029 files changed

+92273
-0
lines changed

.editorconfig

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.{yml,yaml}]
15+
indent_size = 2
16+
17+
[docker-compose.yml]
18+
indent_size = 4

.env.example

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
APP_NAME="Laravel Quick-Start"
2+
APP_ENV=local
3+
APP_KEY=
4+
APP_DEBUG=true
5+
APP_URL=http://localhost
6+
7+
LOG_CHANNEL=stack
8+
LOG_DEPRECATIONS_CHANNEL=null
9+
LOG_LEVEL=debug
10+
11+
DB_CONNECTION=mysql
12+
DB_HOST=127.0.0.1
13+
DB_PORT=3306
14+
DB_DATABASE=laravel
15+
DB_USERNAME=root
16+
DB_PASSWORD=
17+
18+
BROADCAST_DRIVER=log
19+
CACHE_DRIVER=file
20+
FILESYSTEM_DISK=local
21+
QUEUE_CONNECTION=sync
22+
SESSION_DRIVER=file
23+
SESSION_LIFETIME=120
24+
25+
MEMCACHED_HOST=127.0.0.1
26+
27+
REDIS_HOST=127.0.0.1
28+
REDIS_PASSWORD=null
29+
REDIS_PORT=6379
30+
31+
MAIL_MAILER=smtp
32+
MAIL_HOST=mailhog
33+
MAIL_PORT=1025
34+
MAIL_USERNAME=null
35+
MAIL_PASSWORD=null
36+
MAIL_ENCRYPTION=null
37+
MAIL_FROM_ADDRESS="hello@example.com"
38+
MAIL_FROM_NAME="${APP_NAME}"
39+
40+
AWS_ACCESS_KEY_ID=
41+
AWS_SECRET_ACCESS_KEY=
42+
AWS_DEFAULT_REGION=us-east-1
43+
AWS_BUCKET=
44+
AWS_USE_PATH_STYLE_ENDPOINT=false
45+
46+
PUSHER_APP_ID=
47+
PUSHER_APP_KEY=
48+
PUSHER_APP_SECRET=
49+
PUSHER_APP_CLUSTER=mt1
50+
51+
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
52+
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

.gitattributes

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
* text=auto
2+
3+
# Enforce Unix newlines
4+
*.css text eol=lf linguist-vendored
5+
*.html text eol=lf
6+
*.js text eol=lf linguist-vendored
7+
*.json text eol=lf
8+
*.md text eol=lf
9+
*.scss text eol=lf linguist-vendored
10+
*.svg text eol=lf
11+
*.txt text eol=lf
12+
*.xml text eol=lf
13+
*.yml text eol=lf
14+
15+
# Don't diff or textually merge source maps
16+
*.map binary
17+
18+
CHANGELOG.md export-ignore

.gitignore

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/coverage
2+
/node_modules
3+
/public/css
4+
/public/assets
5+
/public/js
6+
/public/fonts
7+
/public/hot
8+
/public/storage
9+
/public/mix-manifest.json
10+
/storage/*.key
11+
/vendor
12+
/.vscode
13+
*.sublime-project
14+
*.sublime-workspace
15+
_ide_helper.php
16+
.DS_Store
17+
.env
18+
.env.backup
19+
.idea
20+
.php_cs.cache
21+
.phpunit.result.cache
22+
.phpstorm.meta.php
23+
.project
24+
composer.phar
25+
coverage.xml
26+
error.log
27+
Homestead.json
28+
Homestead.yaml
29+
npm-debug.log
30+
output.txt
31+
Thumbs.db
32+
yarn-error.log
33+
/public/sitemaps/

.styleci.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
php:
2+
preset: laravel
3+
version: 9
4+
disabled:
5+
- no_unused_imports
6+
finder:
7+
not-name:
8+
- index.php
9+
- server.php
10+
js:
11+
finder:
12+
not-name:
13+
- webpack.mix.js
14+
css: true

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Vijay Goswami & James L Masi
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
2+
[![](https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg)](https://laravel.com)
3+
4+
![License](https://img.shields.io/packagist/l/laravel/framework)
5+
6+
# About Laravel Quick-Start
7+
8+
Laravel Quickstart is a bolierplate for Laravel Application with typical packages preinstalled and configured to extend a full fledged application. We tried to make it as minimal as possible.
9+
10+
Here are some of its features:
11+
- Separate Views, Routes, Controllers directories for Frontend(Public Interface) and Backend(Admin Interface)
12+
- Both Frontend and Backend utilizes [TailwindCSSv3](https://tailwindcss.com/) as frontend framework
13+
- User Management [Laravel Fortify](https://github.com/laravel/fortify) package, with social login [Socialite](https://github.com/laravel/socialite) and Roles and Permissions [Spatie Laravel Permissions](https://github.com/spatie/laravel-permission) package
14+
- Integrated [Log Viewer](https://github.com/ARCANEDEV/LogViewer)
15+
16+
17+
We are trying to make the package easier to deploy.
18+
19+
## How to Install
20+
21+
22+
## Laravel Sponsors
23+
24+
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](https://patreon.com/taylorotwell).
25+
26+
### Other Packages Included
27+
28+
- **[Laravel CORS](https://github.com/fruitcake/laravel-cors)**
29+
30+
31+
## Contributing
32+
33+
Thank you for considering contributing to the Laravel Quick-Start
34+
project! Please feel free to make any pull requests, or e-mail me a feature request you would like to see in the future to James L Masi at [jameslmasi27@gmail.com](mailto:jameslmasi27@gmail.com).
35+
36+
## License
37+
38+
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

app/Actions/Fortify/CreateNewUser.php

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
3+
namespace App\Actions\Fortify;
4+
5+
use App\Events\Auth\UserRegistered;
6+
use App\Models\User;
7+
use App\Rules\Captcha;
8+
use Illuminate\Support\Facades\Hash;
9+
use Illuminate\Support\Facades\Validator;
10+
use Illuminate\Validation\Rule;
11+
use Laravel\Fortify\Contracts\CreatesNewUsers;
12+
13+
class CreateNewUser implements CreatesNewUsers
14+
{
15+
use PasswordValidationRules;
16+
17+
/**
18+
* Validate and create a newly registered user.
19+
*
20+
* @param array $input
21+
* @return \App\Models\User
22+
*/
23+
public function create(array $input)
24+
{
25+
Validator::make($input, [
26+
'first_name' => ['required', 'string', 'max:255', 'min:3'],
27+
'last_name' => ['string', 'max:255', 'min:2'],
28+
'email' => ['required', 'string', 'email', 'max:255', Rule::unique(User::class),],
29+
'mobile' => ['string', 'digits:10', Rule::unique(User::class),],
30+
'password' => $this->passwordRules(),
31+
'g-captcha-response' => ['required_if:captcha_status,true', new Captcha],
32+
], [
33+
'g-recaptcha-response.require_if' => __('validation.required', ['attribute' => 'captcha']),
34+
])->validate();
35+
36+
$user = User::create([
37+
'first_name' => $input['first_name'],
38+
'last_name' => $input['last_name'],
39+
'email' => $input['email'],
40+
'mobile' => $input['mobile'],
41+
'password' => Hash::make($input['password']),
42+
'last_login_at' => now(),
43+
'last_login_ip' => request()->getClientIp(),
44+
]);
45+
event(new UserRegistered($user));
46+
return $user;
47+
}
48+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
namespace App\Actions\Fortify;
4+
5+
use Laravel\Fortify\Rules\Password;
6+
7+
trait PasswordValidationRules
8+
{
9+
/**
10+
* Get the validation rules used to validate passwords.
11+
*
12+
* @return array
13+
*/
14+
protected function passwordRules()
15+
{
16+
return ['required', 'string', new Password, 'confirmed'];
17+
}
18+
}
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
namespace App\Actions\Fortify;
4+
5+
use Illuminate\Support\Facades\Hash;
6+
use Illuminate\Support\Facades\Validator;
7+
use Laravel\Fortify\Contracts\ResetsUserPasswords;
8+
9+
class ResetUserPassword implements ResetsUserPasswords
10+
{
11+
use PasswordValidationRules;
12+
13+
/**
14+
* Validate and reset the user's forgotten password.
15+
*
16+
* @param mixed $user
17+
* @param array $input
18+
* @return void
19+
*/
20+
public function reset($user, array $input)
21+
{
22+
Validator::make($input, [
23+
'password' => $this->passwordRules(),
24+
])->validate();
25+
26+
$user->forceFill([
27+
'password' => Hash::make($input['password']),
28+
])->save();
29+
}
30+
}
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
namespace App\Actions\Fortify;
4+
5+
use Illuminate\Support\Facades\Hash;
6+
use Illuminate\Support\Facades\Validator;
7+
use Laravel\Fortify\Contracts\UpdatesUserPasswords;
8+
9+
class UpdateUserPassword implements UpdatesUserPasswords
10+
{
11+
use PasswordValidationRules;
12+
13+
/**
14+
* Validate and update the user's password.
15+
*
16+
* @param mixed $user
17+
* @param array $input
18+
* @return void
19+
*/
20+
public function update($user, array $input)
21+
{
22+
Validator::make($input, [
23+
'current_password' => ['required', 'string'],
24+
'password' => $this->passwordRules(),
25+
])->after(function ($validator) use ($user, $input) {
26+
if (!isset($input['current_password']) || !Hash::check($input['current_password'], $user->password)) {
27+
$validator->errors()->add('current_password', __('The provided password does not match your current password.'));
28+
}
29+
})->validateWithBag('updatePassword');
30+
31+
$user->forceFill([
32+
'password' => Hash::make($input['password']),
33+
])->save();
34+
}
35+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?php
2+
3+
namespace App\Actions\Fortify;
4+
5+
use Illuminate\Contracts\Auth\MustVerifyEmail;
6+
use Illuminate\Support\Facades\Validator;
7+
use Illuminate\Validation\Rule;
8+
use Laravel\Fortify\Contracts\UpdatesUserProfileInformation;
9+
10+
class UpdateUserProfileInformation implements UpdatesUserProfileInformation
11+
{
12+
/**
13+
* Validate and update the given user's profile information.
14+
*
15+
* @param mixed $user
16+
* @param array $input
17+
* @return void
18+
*/
19+
public function update($user, array $input)
20+
{
21+
Validator::make($input, [
22+
'first_name' => ['required', 'string', 'max:255'],
23+
'last_name' => ['required', 'string', 'max:255'],
24+
'mobile' => ['string', 'digits:10', Rule::unique('users')->ignore($user->id)],
25+
'email' => ['required', 'string', 'email', 'max:255', Rule::unique('users')->ignore($user->id),],
26+
])->validateWithBag('updateProfileInformation');
27+
28+
if ($input['email'] !== $user->email &&
29+
$user instanceof MustVerifyEmail) {
30+
$this->updateVerifiedUser($user, $input);
31+
} else {
32+
$user->forceFill([
33+
'first_name' => $input['first_name'],
34+
'last_name' => $input['last_name'],
35+
'email' => $input['email'],
36+
'mobile' => $input['mobile'],
37+
])->save();
38+
}
39+
}
40+
41+
/**
42+
* Update the given verified user's profile information.
43+
*
44+
* @param mixed $user
45+
* @param array $input
46+
* @return void
47+
*/
48+
protected function updateVerifiedUser($user, array $input)
49+
{
50+
$user->forceFill([
51+
'first_name' => $input['first_name'],
52+
'last_name' => $input['last_name'],
53+
'email' => $input['email'],
54+
'mobile' => $input['mobile'],
55+
'email_verified_at' => null,
56+
])->save();
57+
58+
$user->sendEmailVerificationNotification();
59+
}
60+
}

0 commit comments

Comments
 (0)