-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 35aae83
Showing
187 changed files
with
213,899 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 4 | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.{yml,yaml}] | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
APP_NAME=Laravel | ||
APP_ENV=local | ||
APP_KEY= | ||
APP_DEBUG=true | ||
APP_URL=http://localhost | ||
|
||
LOG_CHANNEL=stack | ||
|
||
DB_CONNECTION=mysql | ||
DB_HOST=127.0.0.1 | ||
DB_PORT=3306 | ||
DB_DATABASE=laravel | ||
DB_USERNAME=root | ||
DB_PASSWORD= | ||
|
||
BROADCAST_DRIVER=log | ||
CACHE_DRIVER=file | ||
QUEUE_CONNECTION=sync | ||
SESSION_DRIVER=database | ||
SESSION_LIFETIME=120 | ||
|
||
REDIS_HOST=127.0.0.1 | ||
REDIS_PASSWORD=null | ||
REDIS_PORT=6379 | ||
|
||
MAIL_MAILER=smtp | ||
MAIL_HOST=smtp.mailtrap.io | ||
MAIL_PORT=2525 | ||
MAIL_USERNAME=null | ||
MAIL_PASSWORD=null | ||
MAIL_ENCRYPTION=null | ||
MAIL_FROM_ADDRESS=null | ||
MAIL_FROM_NAME="${APP_NAME}" | ||
|
||
AWS_ACCESS_KEY_ID= | ||
AWS_SECRET_ACCESS_KEY= | ||
AWS_DEFAULT_REGION=us-east-1 | ||
AWS_BUCKET= | ||
|
||
PUSHER_APP_ID= | ||
PUSHER_APP_KEY= | ||
PUSHER_APP_SECRET= | ||
PUSHER_APP_CLUSTER=mt1 | ||
|
||
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" | ||
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
* text=auto | ||
*.css linguist-vendored | ||
*.scss linguist-vendored | ||
*.js linguist-vendored | ||
CHANGELOG.md export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/node_modules | ||
/public/hot | ||
/public/storage | ||
/storage/*.key | ||
/vendor | ||
.env | ||
.env.backup | ||
.phpunit.result.cache | ||
Homestead.json | ||
Homestead.yaml | ||
npm-debug.log | ||
yarn-error.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
php: | ||
preset: laravel | ||
disabled: | ||
- unused_use | ||
finder: | ||
not-name: | ||
- index.php | ||
- server.php | ||
js: | ||
finder: | ||
not-name: | ||
- webpack.mix.js | ||
css: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Larawind - Laravel 8.0+ Jetstream and Tailwind CSS Admin Theme | ||
|
||
This project is created with [Laravel Jetstream](https://jetstream.laravel.com/1.x/introduction.html) Framework and [Tailwind CSS](https://tailwindcss.com), the admin environment is desing by [Windmill Dashboard](https://windmill-dashboard.vercel.app/). | ||
|
||
## Requirements | ||
|
||
- Laravel installer | ||
- Composer | ||
- Npm installer | ||
|
||
## Installation | ||
|
||
``` | ||
# Clone the repository from GitHub and open the directory: | ||
git clone https://github.com/miten5/larawind.git | ||
# cd into your project directory | ||
cd larawind | ||
#install composer and npm packages | ||
composer install | ||
npm install && npm run dev | ||
# Start prepare the environment: | ||
cp .env.example .env // setup database credentials | ||
php artisan key:generate | ||
php artisan migrate | ||
# Run your server | ||
php artisan serve | ||
``` | ||
### Project made possible thanks to: | ||
|
||
- [Laravel Jetstream](https://jetstream.laravel.com/1.x/introduction.html) | ||
- [Tailwind CSS](https://tailwindcss.com/) | ||
- [Windmill Dashboard](https://windmill-dashboard.vercel.app/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
namespace App\Actions\Fortify; | ||
|
||
use App\Models\Team; | ||
use App\Models\User; | ||
use Illuminate\Support\Facades\DB; | ||
use Illuminate\Support\Facades\Hash; | ||
use Illuminate\Support\Facades\Validator; | ||
use Laravel\Fortify\Contracts\CreatesNewUsers; | ||
|
||
class CreateNewUser implements CreatesNewUsers | ||
{ | ||
use PasswordValidationRules; | ||
|
||
/** | ||
* Create a newly registered user. | ||
* | ||
* @param array $input | ||
* @return \App\Models\User | ||
*/ | ||
public function create(array $input) | ||
{ | ||
Validator::make($input, [ | ||
'name' => ['required', 'string', 'max:255'], | ||
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], | ||
'password' => $this->passwordRules(), | ||
])->validate(); | ||
|
||
return DB::transaction(function () use ($input) { | ||
return tap(User::create([ | ||
'name' => $input['name'], | ||
'email' => $input['email'], | ||
'password' => Hash::make($input['password']), | ||
]), function (User $user) { | ||
$this->createTeam($user); | ||
}); | ||
}); | ||
} | ||
|
||
/** | ||
* Create a personal team for the user. | ||
* | ||
* @param \App\Models\User $user | ||
* @return void | ||
*/ | ||
protected function createTeam(User $user) | ||
{ | ||
$user->ownedTeams()->save(Team::forceCreate([ | ||
'user_id' => $user->id, | ||
'name' => explode(' ', $user->name, 2)[0]."'s Team", | ||
'personal_team' => true, | ||
])); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace App\Actions\Fortify; | ||
|
||
use Laravel\Fortify\Rules\Password; | ||
|
||
trait PasswordValidationRules | ||
{ | ||
/** | ||
* Get the validation rules used to validate passwords. | ||
* | ||
* @return array | ||
*/ | ||
protected function passwordRules() | ||
{ | ||
return ['required', 'string', new Password, 'confirmed']; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace App\Actions\Fortify; | ||
|
||
use Illuminate\Support\Facades\Hash; | ||
use Illuminate\Support\Facades\Validator; | ||
use Laravel\Fortify\Contracts\ResetsUserPasswords; | ||
|
||
class ResetUserPassword implements ResetsUserPasswords | ||
{ | ||
use PasswordValidationRules; | ||
|
||
/** | ||
* Validate and reset the user's forgotten password. | ||
* | ||
* @param mixed $user | ||
* @param array $input | ||
* @return void | ||
*/ | ||
public function reset($user, array $input) | ||
{ | ||
Validator::make($input, [ | ||
'password' => $this->passwordRules(), | ||
])->validateWithBag('updatePassword'); | ||
|
||
$user->forceFill([ | ||
'password' => Hash::make($input['password']), | ||
])->save(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace App\Actions\Fortify; | ||
|
||
use Illuminate\Support\Facades\Hash; | ||
use Illuminate\Support\Facades\Validator; | ||
use Laravel\Fortify\Contracts\UpdatesUserPasswords; | ||
|
||
class UpdateUserPassword implements UpdatesUserPasswords | ||
{ | ||
use PasswordValidationRules; | ||
|
||
/** | ||
* Validate and update the user's password. | ||
* | ||
* @param mixed $user | ||
* @param array $input | ||
* @return void | ||
*/ | ||
public function update($user, array $input) | ||
{ | ||
Validator::make($input, [ | ||
'current_password' => ['required', 'string'], | ||
'password' => $this->passwordRules(), | ||
])->after(function ($validator) use ($user, $input) { | ||
if (! Hash::check($input['current_password'], $user->password)) { | ||
$validator->errors()->add('current_password', __('The provided password does not match your current password.')); | ||
} | ||
})->validateWithBag('updatePassword'); | ||
|
||
$user->forceFill([ | ||
'password' => Hash::make($input['password']), | ||
])->save(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace App\Actions\Fortify; | ||
|
||
use Illuminate\Support\Facades\Validator; | ||
use Illuminate\Validation\Rule; | ||
use Laravel\Fortify\Contracts\UpdatesUserProfileInformation; | ||
|
||
class UpdateUserProfileInformation implements UpdatesUserProfileInformation | ||
{ | ||
/** | ||
* Validate and update the given user's profile information. | ||
* | ||
* @param mixed $user | ||
* @param array $input | ||
* @return void | ||
*/ | ||
public function update($user, array $input) | ||
{ | ||
Validator::make($input, [ | ||
'name' => ['required', 'string', 'max:255'], | ||
'email' => ['required', 'email', 'max:255', Rule::unique('users')->ignore($user->id)], | ||
'photo' => ['nullable', 'image', 'max:1024'], | ||
])->validateWithBag('updateProfileInformation'); | ||
|
||
if (isset($input['photo'])) { | ||
$user->updateProfilePhoto($input['photo']); | ||
} | ||
|
||
$user->forceFill([ | ||
'name' => $input['name'], | ||
'email' => $input['email'], | ||
])->save(); | ||
} | ||
} |
Oops, something went wrong.