# Install

we now have a good env to start building our app, so let's start by setup Laravel v9 on our PC

### Create a Folder

```bash
cd Sites
```

let's now go and create a new project inside the Sites directory

### Install Laravel

```bash
composer create-project laravel/laravel vilt
```

### Link With Valet +

it's working now we have a new database you can check it in your phpmyadmin, now let's link and secure the app

```bash
valet link
valet secure
```

### Update .env

now to can go and create a new database you can use Valet+ to do that

for MacOS Users

```bash
valet db create vilt
```

for Linux Users

```bash
valet db:create vilt
```

the last step to run the project is to edit your .env file with the database info and APP\_URL.

```
APP_NAME=vilt
APP_URL=https://vilt.test

DB_DATABASE=vilt
DB_USERNAME=root
DB_PASSWORD=12345678
```

### Clear Cache

Clear cache to reset .env vars

```bash
php artisan config:cache
php artisan migrate
```

### Install VILT

```bash
composer required queents/vilt
```

Now Install VILT

```bash
php artisan vilt:install
```

it will ask you to select the UI

> we are recommending you to use **"FilamentUI"** because "UI" is still under development

### Select Modules

after install ui it will ask you to select plugins you when to install you can enter it like

```bash
1,2,3,4,5,6
```

after the install finish it will ask you to add "FilamentUI" to .env and modules

### Run migration

```bash
php artisan migrate
```

### Install Roles

new run this command to generate the main role and generate username and password

```bash
php artisan roles:install
```

### Clear View

```bash
php artisan optimize
```

### Run Yarn

before you start building your app assets if you are not using `macOS` you need to change the path of `vite.config.js` from `.config/valet` to `.valet` because the change of path between OS Like

```javascript
- let keyPath = resolve(homedir(), `.config/valet/Certificates/${host}.key`);
- let certificatePath = resolve(homedir(), `.config/valet/Certificates/${host}.crt`);

+ let keyPath = resolve(homedir(), `.valet/Certificates/${host}.key`);
+ let certificatePath = resolve(homedir(), `.valet/Certificates/${host}.crt`);
```

&#x20;now install the nodejs packages by use yarn

```bash
yarn
```

after install all packages build your view

```bash
yarn build
```

you can now login to the admin from `/admin/login`

Email:

```bash
admin@admin.com
```

Password:

```bash
QTS@2022
```

***

### Fix Errors

when you try to access profile you may get an error because of `two_factor_confirmed_at` filed it's can fix by easy make a new migration and add it

```php
Schema::table('users', function (Blueprint $table) {
   $table->timestamp('two_factor_confirmed_at')
     ->after('two_factor_recovery_codes')
     ->nullable();
});
```

and run migrate

```bash
php artisan migrate
```
