Skip to content

Commit

Permalink
cleaning up some data
Browse files Browse the repository at this point in the history
  • Loading branch information
tnylea committed Oct 18, 2024
1 parent 62911cd commit e148e94
Show file tree
Hide file tree
Showing 44 changed files with 34 additions and 41 deletions.
50 changes: 22 additions & 28 deletions app/Filament/Resources/UserResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@

namespace App\Filament\Resources;

use App\Filament\Resources\UserResource\Pages;
use App\Filament\Resources\UserResource\RelationManagers;
use Wave\User;
use App\Models\User;
use Filament\Forms;
use Filament\Forms\Form;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Forms\Get;
use Filament\Forms\Set;
use Filament\Forms\Form;
use Filament\Tables\Table;
use Filament\Resources\Resource;
use Illuminate\Support\Facades\Hash;
use Illuminate\Database\Eloquent\Builder;
use App\Filament\Resources\UserResource\Pages;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use App\Filament\Resources\UserResource\RelationManagers;

class UserResource extends Resource
{
Expand All @@ -26,46 +28,38 @@ public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('role_id')
->numeric()
->required()
->rule('exists:roles,id'),
Forms\Components\TextInput::make('name')
->required()
->maxLength(191),
Forms\Components\TextInput::make('username')
->required()
->maxLength(191),
Forms\Components\TextInput::make('email')
->email()
->required()
->maxLength(191),
Forms\Components\TextInput::make('avatar')
->required()
->maxLength(191)
->default('users/default.png'),
Forms\Components\FileUpload::make('avatar')
->image(),
Forms\Components\DateTimePicker::make('email_verified_at'),
Forms\Components\TextInput::make('password')
->password()
->dehydrateStateUsing(fn ($state) => Hash::make($state))
->required(fn (string $context): bool => $context === 'create')
->maxLength(191),
Forms\Components\Textarea::make('settings')
->columnSpanFull(),
Forms\Components\TextInput::make('username')
->required()
->maxLength(191),
Forms\Components\TextInput::make('stripe_id')
->maxLength(191),
Forms\Components\TextInput::make('card_brand')
->maxLength(191),
Forms\Components\TextInput::make('card_last_four')
->maxLength(191),
->dehydrated(fn ($state) => filled($state))
->required(fn (string $context): bool => $context === 'create'),
Forms\Components\Select::make('roles')
->multiple()
->relationship('roles', 'name')
->preload()
->searchable()
->required(),
Forms\Components\DateTimePicker::make('trial_ends_at'),
Forms\Components\TextInput::make('verification_code')
->maxLength(191),
Forms\Components\TextInput::make('verified')
->numeric(),
Forms\Components\Toggle::make('verified')
]);
}


public static function table(Table $table): Table
{
return $table
Expand Down
1 change: 1 addition & 0 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class User extends WaveUser
'name',
'email',
'username',
'avatar',
'password',
'role_id',
'verification_code',
Expand Down
4 changes: 0 additions & 4 deletions database/seeders/UsersTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,8 @@ public function run()
'avatar' => 'users/default.png',
'password' => '$2y$10$L8MjmjVVOCbyLHbp7pq/9.1ZEEa5AqE67ZXLd2M4.res05a3Rz/G2',
'remember_token' => '4oXDVo48Lm1pc4j7NkWI9cMO4hv5OIEJFMrqjSCKQsIwWMGRFYDvNpdioBfo',
'settings' => NULL,
'created_at' => '2017-11-21 16:07:22',
'updated_at' => '2018-09-22 23:34:02',
'stripe_id' => NULL,
'card_brand' => NULL,
'card_last_four' => NULL,
'trial_ends_at' => NULL,
'verification_code' => NULL,
'verified' => 1,
Expand Down
5 changes: 3 additions & 2 deletions resources/themes/anchor/pages/settings/profile.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
use function Laravel\Folio\{name};
use function Laravel\Folio\{middleware, name};
use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Forms\Contracts\HasForms;
use Filament\Forms\Form;
Expand All @@ -9,6 +9,7 @@
use Wave\Traits\HasDynamicFields;
use Wave\ApiKey;
middleware('auth');
name('settings.profile');
new class extends Component implements HasForms
Expand Down Expand Up @@ -164,7 +165,7 @@ private function saveFormFields($state){
"
class="relative w-full">
<form wire:submit="save" class="w-full">
<div class="relative flex flex-col lg:px-10 mt-5">
<div class="relative flex flex-col mt-5 lg:px-10">
<div class="relative flex-shrink-0 w-32 h-32 cursor-pointer group">
<img id="preview" src="{{ auth()->user()->avatar() . '?' . time() }}" class="w-32 h-32 rounded-full">

Expand Down
6 changes: 5 additions & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@
use Wave\Facades\Wave;

// Wave routes
Wave::routes();
Wave::routes();

Route::get('role', function(){
dd(\App\Models\User::find(2)->roles);
});
Binary file not shown.
Binary file not shown.
Binary file removed storage/app/public/auth/background.jpg
Binary file not shown.
Binary file removed storage/app/public/avatars/admin.png
Binary file not shown.
Binary file removed storage/app/public/avatars/arbyman.png
Binary file not shown.
Binary file removed storage/app/public/avatars/avatar.jpg
Binary file not shown.
Binary file removed storage/app/public/avatars/johnanderson.png
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file removed storage/app/public/images/wave-white.png
Binary file not shown.
Binary file not shown.
Binary file removed storage/app/public/pages/page1.jpg
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed storage/app/public/public/auth/background.jpg
Binary file not shown.
Binary file removed storage/app/public/public/auth/favicon-dark.png
Binary file not shown.
Binary file removed storage/app/public/public/auth/favicon.png
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed storage/app/public/settings/April2021/play-icon.png
Diff not rendered.
Diff not rendered.
Binary file removed storage/app/public/settings/April2021/tails-bg.png
Diff not rendered.
Binary file removed storage/app/public/settings/April2021/tails-icon.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
2 changes: 1 addition & 1 deletion storage/dump.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,7 @@ CREATE TABLE `users` (
LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;

INSERT INTO `users` (`id`, `role_id`, `name`, `email`, `username`, `avatar`, `password`, `remember_token`, `settings`, `created_at`, `updated_at`, `stripe_id`, `card_brand`, `card_last_four`, `trial_ends_at`, `verification_code`, `verified`)
INSERT INTO `users` (`id`, `role_id`, `name`, `email`, `username`, `avatar`, `password`, `remember_token`, `settings`, `created_at`, `updated_at`, `trial_ends_at`, `verification_code`, `verified`)
VALUES
(1,1,'Tony Lea','tnylea@gmail.com','tnylea','users/default.png','$2y$10$NTj4nKIuYQpkiGuyAP8Kl.3vsX2TiiF/b7I3ELoF4mxkINxpvAI/a','pBCFKLJ0KAuikvH3Jl4l7iRbnyItD7QLSwgpnku83ydezT9ATd0d9j7fwkq0',NULL,'2017-11-21 16:07:22','2018-08-26 20:18:24',NULL,NULL,NULL,NULL,NULL,1),
(9,2,'John Doe','johndoe@gmail.com','johndoe','users/default.png','$2y$10$3VqIf6CSwroI2kz7aqMXx.2MXa.ERlRWZ/vJ1dKPaB5aF1lbhefGm','06HEVc3NqyMs0rpUra4XAh2SLf5id691aKdv8d2dYNEHVVdAZAZiydF6zSCx',NULL,'2018-06-22 21:32:49','2018-06-22 21:32:49',NULL,NULL,NULL,NULL,NULL,1),
Expand Down
2 changes: 1 addition & 1 deletion theme.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"name": "anchor"
"name": "cove"
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,8 @@ public function up(): void
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->string('remember_token', 100)->nullable();
$table->text('settings')->nullable();
$table->timestamps();
$table->string('username')->unique();
$table->string('stripe_id')->nullable();
$table->string('card_brand')->nullable();
$table->string('card_last_four')->nullable();
$table->dateTime('trial_ends_at')->nullable();
$table->string('verification_code')->nullable();
$table->tinyInteger('verified')->nullable();
Expand Down
1 change: 1 addition & 0 deletions wave/src/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class User extends AuthUser implements JWTSubject, HasAvatar, FilamentUser
'name',
'email',
'username',
'avatar',
'password',
'role_id',
'verification_code',
Expand Down

0 comments on commit e148e94

Please sign in to comment.