Skip to content

Commit 01507ec

Browse files
author
ahmadhuss
committed
feat: Updated CategoryFactory and AppServiceProvider file
1 parent b127c3e commit 01507ec

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

app/Providers/AppServiceProvider.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace App\Providers;
44

5+
use Illuminate\Support\Facades\App;
6+
use Illuminate\Support\Facades\URL;
57
use Illuminate\Support\ServiceProvider;
68

79
class AppServiceProvider extends ServiceProvider
@@ -23,6 +25,10 @@ public function register()
2325
*/
2426
public function boot()
2527
{
26-
//
28+
if (App::Environment('local')) {
29+
URL::forceScheme('http');
30+
} else {
31+
URL::forceScheme('https');
32+
}
2733
}
2834
}

database/factories/CategoryFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class CategoryFactory extends Factory
2222
public function definition()
2323
{
2424
return [
25-
'name' => $this->faker->word()
25+
'name' => $this->faker->unique()->word()
2626
];
2727
}
2828
}

0 commit comments

Comments
 (0)