Skip to content

Commit c726f82

Browse files
committed
broken codes fix, auth upgraded. gitignore tracked properly
1 parent 80581db commit c726f82

25 files changed

+484
-32
lines changed

.env.example

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
APP_NAME=Liberu
2+
APP_ENV=testing
3+
APP_KEY=base64:GS0VwCqzgSVBnM0Wz/Ig610q86M+GIvyVmzQQvrL7Xw=
4+
APP_DEBUG=true
5+
APP_URL=http://localhost
6+
7+
OWNER_COMPANY_ID=1
8+
DB_TENANT_DATABASE=tenant
9+
10+
LOG_CHANNEL=stack
11+
12+
DB_CONNECTION=mysql
13+
DB_HOST=127.0.0.1
14+
DB_PORT=3306
15+
DB_DATABASE=test
16+
DB_USERNAME=root
17+
DB_PASSWORD=
18+
19+
BROADCAST_DRIVER=log
20+
CACHE_DRIVER=file
21+
FILESYSTEM_DISK=local
22+
SESSION_DRIVER=file
23+
SESSION_LIFETIME=120
24+
25+
CACHE_LIFETIME=60
26+
27+
LOGIN_ATTEMPTS_PER_MINUTE=5
28+
PASSWORD_LIFETIME=0
29+
PASSWORD_MIN_LENGTH=6
30+
PASSWORD_MIXED_CASE=0
31+
PASSWORD_NUMERIC=0
32+
PASSWORD_SPECIAL=0
33+
34+
REDIS_HOST=127.0.0.1
35+
REDIS_PASSWORD=null
36+
REDIS_PORT=6379
37+
38+
MAIL_MAILER=log
39+
MAIL_HOST=
40+
MAIL_PORT=
41+
MAIL_USERNAME=null
42+
MAIL_PASSWORD=null
43+
MAIL_ENCRYPTION=null
44+
MAIL_FROM_ADDRESS=null
45+
MAIL_FROM_NAME="${APP_NAME}"
46+
47+
MAILGUN_DOMAIN=
48+
MAILGUN_SECRET=
49+
MAILGUN_ENDPOINT=api.mailgun.net
50+
51+
AWS_ACCESS_KEY_ID=
52+
AWS_SECRET_ACCESS_KEY=
53+
AWS_DEFAULT_REGION=us-east-1
54+
AWS_BUCKET=
55+
56+
PUSHER_APP_ID=
57+
PUSHER_APP_KEY=
58+
PUSHER_APP_SECRET=
59+
PUSHER_APP_CLUSTER=mt1
60+
61+
SENTRY_LARAVEL_DSN=
62+
63+
TELESCOPE_ENABLED=0
64+
SCOUT_DRIVER=null
65+
66+
ENSO_API_TOKEN=
67+
68+
TINY_MCE_API_KEY=
69+
70+
SANCTUM_STATEFUL_DOMAINS=localhost,127.0.0.1,127.0.0.1:8000,127.0.0.1:3000,localhost:3000,localhost:8080,::1

.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/vendor/
2+
3+
node_modules/
4+
npm-debug.log
5+
yarn-error.log
6+
7+
# Laravel 4 specific
8+
bootstrap/compiled.php
9+
app/storage/
10+
11+
# Laravel 5 & Lumen specific
12+
public/storage
13+
public/hot
14+
15+
# Laravel 5 & Lumen specific with changed public path
16+
public_html/storage
17+
public_html/hot
18+
19+
storage/*.key
20+
.env
21+
Homestead.yaml
22+
Homestead.json
23+
/.vagrant
24+
.phpunit.result.cache
25+
rr
26+
.rr.yaml

app/Helpers/SiteSettingsHelper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
namespace App\Helpers;
44

5-
use App\Facades\SiteSettings;
5+
use App\Models\SiteSettings;
66

77
class SiteSettingsHelper
88
{
9-
public static function get($key, $default = null)
9+
public static function get($default = null)
1010
{
11-
return SiteSettings::get($key) ?? $default;
11+
return SiteSettings::first() ?? $default;
1212
}
1313
}

app/Models/SiteSettings.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
namespace App\Models;
4+
5+
use Illuminate\Database\Eloquent\Factories\HasFactory;
6+
use Illuminate\Database\Eloquent\Model;
7+
8+
class SiteSettings extends Model
9+
{
10+
use HasFactory;
11+
12+
protected $fillable = [
13+
'name',
14+
'currency',
15+
'default_language',
16+
'address',
17+
'country',
18+
'email',
19+
'phone_01',
20+
'phone_02',
21+
'phone_03',
22+
'phone_04',
23+
'facebook',
24+
'twitter',
25+
'github',
26+
'youtube',
27+
'sales_commission_percentage',
28+
'lettings_commission_percentage',
29+
];
30+
}

database/migrations/2023_05_25_000000_create_site_settings_table.php

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,22 @@ public function up()
1010
{
1111
Schema::create('site_settings', function (Blueprint $table) {
1212
$table->id();
13-
$table->string('name');
14-
$table->string('currency');
15-
$table->string('default_language');
16-
$table->text('address');
17-
$table->string('country');
18-
$table->string('email');
13+
$table->string('name')->nullable();
14+
$table->string('currency')->nullable();
15+
$table->string('default_language')->nullable();
16+
$table->text('address')->nullable();
17+
$table->string('country')->nullable();
18+
$table->string('email')->nullable();
19+
$table->string('phone_01')->nullable();
20+
$table->string('phone_02')->nullable();
21+
$table->string('phone_03')->nullable();
22+
$table->string('phone_04')->nullable();
23+
$table->string('facebook')->nullable();
24+
$table->string('twitter')->nullable();
25+
$table->string('github')->nullable();
26+
$table->string('youtube')->nullable();
27+
$table->decimal('sales_commission_percentage', 5, 2)->default(1.00);
28+
$table->decimal('lettings_commission_percentage', 5, 2)->default(8.00);
1929
$table->timestamps();
2030
});
2131
}

database/seeders/DatabaseSeeder.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
namespace Database\Seeders;
44

55
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
6+
7+
use App\Models\Menu;
68
use Illuminate\Database\Seeder;
79

810
class DatabaseSeeder extends Seeder
@@ -12,11 +14,12 @@ class DatabaseSeeder extends Seeder
1214
*/
1315
public function run(): void
1416
{
15-
// \App\Models\User::factory(10)->create();
16-
17-
// \App\Models\User::factory()->create([
18-
// 'name' => 'Test User',
19-
// 'email' => 'test@example.com',
20-
// ]);
17+
$this->call([
18+
MenuSeeder::class,
19+
RolesSeeder::class,
20+
SiteSettingsSeeder::class,
21+
TeamSeeder::class,
22+
UserSeeder::class,
23+
]);
2124
}
2225
}

database/seeders/TeamSeeder.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace Database\Seeders;
4+
5+
use App\Models\Team;
6+
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
7+
use Illuminate\Database\Seeder;
8+
9+
class TeamSeeder extends Seeder
10+
{
11+
/**
12+
* Run the database seeds.
13+
*/
14+
public function run(): void
15+
{
16+
$team = Team::create([
17+
'id' => 1,
18+
'name' => 'default',
19+
'personal_team' => false,
20+
'user_id' => 1,
21+
]);
22+
}
23+
}

database/seeders/UserSeeder.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
namespace Database\Seeders;
4+
5+
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
6+
use Illuminate\Database\Seeder;
7+
use Illuminate\Support\Facades\Hash;
8+
use App\Models\User;
9+
use App\Models\Team;
10+
11+
class UserSeeder extends Seeder
12+
{
13+
/**
14+
* Run the database seeds.
15+
*/
16+
public function run(): void
17+
{
18+
$adminUser = User::create([
19+
'name' => 'Admin User',
20+
'email' => 'admin@example.com',
21+
'password' => Hash::make('password'),
22+
'email_verified_at' => now(),
23+
]);
24+
$adminUser->assignRole('admin');
25+
// $this->createTeamForUser($adminUser);
26+
}
27+
28+
private function createTeamForUser($user)
29+
{
30+
$team = Team::first();
31+
$team->users()->attach($user);
32+
$user->current_team_id = 1;
33+
$user->save();
34+
}
35+
}

package-lock.json

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"vite": "^5.1.5"
1717
},
1818
"dependencies": {
19+
"preline": "^2.4.1",
1920
"vite-plugin-static-copy": "^1.0.6"
2021
}
2122
}

0 commit comments

Comments
 (0)