Skip to content

Commit

Permalink
upgrade app to laravel 11.x & typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
fordiquez committed Mar 30, 2024
1 parent 7dc8b04 commit 83f5fa6
Show file tree
Hide file tree
Showing 223 changed files with 7,497 additions and 5,954 deletions.
2 changes: 1 addition & 1 deletion .env.encrypted
Original file line number Diff line number Diff line change
@@ -1 +1 @@
eyJpdiI6IjlIS1dpTVgydkpKVWZ1OHJpYzBKK3c9PSIsInZhbHVlIjoiSW1jQTZ3VHYxVkZsc3pnOWkyV2hudFFRT2NaYWZma2l3OERvYmRQQTlHZENiRHc0aEJidjltc0k4aTlYMHFwcVJqSHVabU54aDVPTk04RTZUS1U4YWhQWnJlUE9BTGthakp2WTJ2WjdSYnorK01Ud2V6NGZnNGZGQlh4VWRkSGRjT2N0ZWtGRmgyaUw0TGkwelpNZ0VHc2NLNkVVMkdnMzZkKzdlVER2aGVSbFpUdXB4SnRlMFpxWWV0RmJjOEJQUjBMdE1xc3dPcTVRWXROYTU0b1FNUHd5eitkRUVGWWM2Sk5CUEMzL2VFcFk1WjYyOXoxSVJmcEsyc3J0RmNBRGg1V2ZaSW9xbFVJekNxNkxWemdjTi9EOWNjSEVueWRDZjBwckcvdjQ4cjVJcTBFaG5NcXJjcDgxWURRVEVGM3N0NTBxSU5NTHZGMlVZdThtNHpuaHlFaG5xblBrQyt0c1c3c1pCNlk4SzBkT2Jua0NlVlg0Q0RXdThyK2JkSVZKYnVYTlpLK0FGOHRjeG9FT3RsU3JNc0Jya2phNXNvc1RacFIrOHpqRmxxSDhjR1BJL2cvbDBMV0xtOUJhK3pSTU9KaWZFOCtnL2ZycUVRN0F5eE1GV2hEdDJtSzh3a3lwSUhXalFpMTZSZE1Da01TWUc3ZGtuNTd1ODBINTE2SlRKM1J5eVR2dVpFTzhJcjlsRGNZb0hEWjh6ZkE4UWdOMG5ML1dVb2wxNlQ5ZzRLQ2V5SmF5L0Y0UDlZOWh5NWlkWjVnV0ZJTVdTYmFkNDdmUWR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changes: 12 additions & 21 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
CONTAINER_NAME=store
APP_NAME="brandford."
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://laravel.store

# Docker Configuration
# XDEBUG_CONFIG possible values: main|osx. Use main value for Linux and Windows, osx value for MacOS.
XDEBUG_CONFIG=main
CONTAINER_NAME=store
APP_URL=http://laravel-store.test

LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=brandford
DB_USERNAME=root
DB_PASSWORD=root
DB_CONNECTION=sqlite
#DB_HOST=mysql
#DB_PORT=3306
#DB_DATABASE=brandford
#DB_USERNAME=root
#DB_PASSWORD=root

BROADCAST_DRIVER=log
CACHE_DRIVER=redis
CACHE_DRIVER=database
FILESYSTEM_DISK=public
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
QUEUE_CONNECTION=database
SESSION_DRIVER=database
SESSION_LIFETIME=120

MEMCACHED_HOST=127.0.0.1
Expand All @@ -48,12 +44,6 @@ AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false

LARAVEL_WEBSOCKETS_HOST=127.0.0.1
LARAVEL_WEBSOCKETS_PORT=6001
LARAVEL_WEBSOCKETS_SSL_LOCAL_CERT=
LARAVEL_WEBSOCKETS_SSL_LOCAL_PK=
LARAVEL_WEBSOCKETS_SSL_PASSPHRASE=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
Expand All @@ -62,6 +52,7 @@ PUSHER_PORT=443
PUSHER_SCHEME=https
PUSHER_APP_CLUSTER=mt1

VITE_APP_NAME="${APP_NAME}"
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_HOST="${PUSHER_HOST}"
VITE_PUSHER_PORT="${PUSHER_PORT}"
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,3 @@ jobs:
- name: Setup directory permissions
run: chmod -R 755 storage bootstrap/cache

- name: Run Unit tests
env:
APP_ENV: testing
DB_CONNECTION: mysql
DB_DATABASE: ${{ env.DB_DATABASE }}
DB_USERNAME: ${{ env.DB_USERNAME }}
DB_PASSWORD: ${{ env.DB_PASSWORD }}
run: php artisan test
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y \
nano \
git \
unzip \
libzip-dev \
libicu-dev \
zlib1g-dev \
libxml2 \
Expand All @@ -31,7 +32,6 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y \
supervisor \
cron \
sudo \
libzip-dev \
&& docker-php-ext-configure pdo_mysql --with-pdo-mysql=mysqlnd \
&& docker-php-ext-configure intl \
&& docker-php-ext-install \
Expand Down
50 changes: 32 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,42 +17,51 @@

### 1. Clone this repository to your local folder

```
```bash
git clone git@github.com:fordiquez/laravel-store.git
```

```
```bash
cd laravel-store
```

### 2. Create .env

```
```bash
cp .env.example .env
```

### 3. Setup .env variables

#### 3.1 Set up base url for your application

```
```dotenv
APP_URL=
```

#### 3.2 Set up your database credentials

```dotenv
DB_CONNECTION=sqlite
#DB_HOST=mysql
#DB_PORT=3306
#DB_DATABASE=brandford
#DB_USERNAME=root
#DB_PASSWORD=root
```
DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=

#### 3.3 Set up your cache & session driver, filesystem disk & queue connection

```dotenv
CACHE_DRIVER=database
FILESYSTEM_DISK=public
QUEUE_CONNECTION=database
SESSION_DRIVER=database
```

#### 3.3 Set up mail SMTP options

```
```dotenv
MAIL_MAILER=
MAIL_HOST=
MAIL_PORT=
Expand All @@ -65,19 +74,19 @@ MAIL_FROM_NAME=

#### 3.4 Set up `multiavatar` API key

```
```dotenv
MULTIAVATAR_API_KEY=
```

#### 3.5 Set up `Countries States Cities` API key

```
```dotenv
CSC_API_KEY=
```

#### 3.7 Setup `Stripe` keys

```
```dotenv
STRIPE_KEY=
STRIPE_SECRET=
STRIPE_WEBHOOK_SECRET=
Expand Down Expand Up @@ -125,6 +134,10 @@ php artisan migrate:fresh --seed
php artisan shield:install --fresh
```

```bash
php artisan db:seed --class=RoleSeeder
```

```bash
php artisan optimize:clear
```
Expand All @@ -142,17 +155,18 @@ stripe login
```

```bash
stripe listen --forward-to laravel.store/stripe/webhook
stripe listen --forward-to laravel-store.test/stripe/webhook
```

### 9. Edit hosts file (Windows 10)
### 9. Edit hosts file

**Path for Windows:**
```
C:\Windows\System32\drivers\etc
```

**Add your application domain:**

```
127.0.0.1 laravel.store
```ini
127.0.0.1 laravel-store.test
```
2 changes: 2 additions & 0 deletions app/Enums/UserGender.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ final class UserGender extends Enum
public const MALE = 'male';

public const FEMALE = 'female';

public const OTHER = 'other';
}
18 changes: 18 additions & 0 deletions app/Enums/UserRole.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

namespace App\Enums;

use BenSampo\Enum\Enum;

final class UserRole extends Enum
{
const SUPER_ADMIN = 'super_admin';

const ADMIN = 'admin';

const MANAGER = 'manager';

const CUSTOMER = 'customer';
}
2 changes: 1 addition & 1 deletion app/Filament/Forms/Components/Rating.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Rating extends Field

protected string $disabledColor = '#6B7280';

protected string $clearIconColor = ' #EF4444 ';
protected string $clearIconColor = '#EF4444';

protected string|Closure $icon = 'heroicon-o-star';

Expand Down
18 changes: 12 additions & 6 deletions app/Filament/Pages/Addresses.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use App\Models\Country;
use App\Models\State;
use App\Models\UserAddress;
use BezhanSalleh\FilamentShield\Traits\HasPageShield;
use Filament\Actions\Action;
use Filament\Forms\Components\Grid;
use Filament\Forms\Components\Hidden;
Expand All @@ -20,15 +21,15 @@
use Filament\Forms\Set;
use Filament\Notifications\Notification;
use Filament\Pages\Page;
use Illuminate\Support\Arr;

class Addresses extends Page implements HasForms
{
use HasPageShield;
use InteractsWithForms;

protected static ?string $navigationIcon = 'heroicon-o-document-text';

protected static ?string $navigationGroup = 'Account';

protected static ?int $navigationSort = 1;

protected static string $view = 'filament.pages.addresses';
Expand Down Expand Up @@ -60,9 +61,11 @@ public function save(): void

UserAddress::whereNotIn('id', $addresses->pluck('id'))->each(fn (UserAddress $address) => $address->delete());

$addresses->filter(fn (array $address) => !empty($address['id']))->each(fn (array $address) => UserAddress::find($address['id'])->update($address));
$addresses->filter(fn (array $address) => !empty($address['id']))
->each(fn (array $address) => UserAddress::find($address['id'])->update(Arr::except($address, ['id', 'created_at', 'updated_at'])));

$addresses->filter(fn (array $address) => empty($address['id']))->each(fn (array $address) => UserAddress::create($address));
$addresses->filter(fn (array $address) => empty($address['id']))
->each(fn (array $address) => UserAddress::create(Arr::except($address, 'id')));

Notification::make()->title('Your addresses has been updated.')->success()->send();
}
Expand All @@ -85,24 +88,27 @@ public function form(Form $form): Form
Hidden::make('id'),
Hidden::make('user_id')->default(auth()->id()),
Select::make('country_id')
->label('Country')
->options(Country::all()->pluck('name', 'id')->toArray())
->required()
->reactive()
->searchable()
->afterStateUpdated(fn (callable $set) => $set('state_id', null)),
Select::make('state_id')
->label('State')
->options(fn (Get $get) => Country::find($get('country_id'))?->states->pluck('name', 'id'))
->required()
->reactive()
->searchable()
->hidden(fn (Get $get) => !$get('country_id'))
->disabled(fn (Get $get) => !$get('country_id'))
->afterStateUpdated(fn (Set $set) => $set('city_id', null)),
Select::make('city_id')
->label('City')
->options(fn (Get $get) => $get('state_id') ? State::find($get('state_id'))?->cities->pluck('name', 'id') : [])
->required()
->reactive()
->searchable()
->hidden(fn (Get $get) => !$get('state_id')),
->disabled(fn (Get $get) => !$get('state_id')),
TextInput::make('street')->required()->maxLength(50),
Grid::make()->schema([
TextInput::make('house')->required()->maxLength(10),
Expand Down
Loading

0 comments on commit 83f5fa6

Please sign in to comment.