Skip to content

Commit 48fed7c

Browse files
authored
Enabled feature (#79)
* 🚧 Installation and config of laravel feature package * Update features list * Update layout * 💄 Add jobs profil dropdown
1 parent 7724c7f commit 48fed7c

20 files changed

+341
-85
lines changed

app/Models/User.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
use Illuminate\Notifications\Notification;
1818
use Illuminate\Support\Facades\Auth;
1919
use Laravel\Sanctum\HasApiTokens;
20+
use LaravelFeature\Featurable\Featurable;
21+
use LaravelFeature\Featurable\FeaturableInterface;
2022
use QCod\Gamify\Gamify;
2123
use Rinvex\Subscriptions\Traits\HasPlanSubscriptions;
2224
use Spatie\MediaLibrary\HasMedia;
@@ -26,7 +28,7 @@
2628
/**
2729
* @mixin IdeHelperUser
2830
*/
29-
class User extends Authenticatable implements MustVerifyEmail, HasMedia
31+
class User extends Authenticatable implements MustVerifyEmail, HasMedia, FeaturableInterface
3032
{
3133
use Gamify;
3234
use HasFactory;
@@ -39,6 +41,7 @@ class User extends Authenticatable implements MustVerifyEmail, HasMedia
3941
use InteractsWithMedia;
4042
use Notifiable;
4143
use Reacts;
44+
use Featurable;
4245

4346
/**
4447
* The attributes that are mass assignable.

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"blade-ui-kit/blade-ui-kit": "^0.3",
1616
"cyrildewit/eloquent-viewable": "^6.1",
1717
"doctrine/dbal": "^3.3",
18+
"francescomalatesta/laravel-feature": "^3.0",
1819
"fruitcake/laravel-cors": "^2.0",
1920
"graham-campbell/markdown": "^14.0",
2021
"guzzlehttp/guzzle": "^7.0.1",

composer.lock

Lines changed: 68 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/app.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@
166166
* Package Service Providers...
167167
*/
168168
App\Providers\FortifyServiceProvider::class,
169+
LaravelFeature\Provider\FeatureServiceProvider::class,
169170

170171
/*
171172
* Application Service Providers...

config/features.php

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?php
2+
3+
return [
4+
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Scanned Paths
8+
|--------------------------------------------------------------------------
9+
|
10+
| You can easily add new features to the system with a simple call to the
11+
| FeatureManager::add() method. However, as a bonus, you can also use
12+
| the artisan feature:scan command.
13+
|
14+
| It will search for every view in resources/views path and add new
15+
| features to the system starting from the @feature() directives in views.
16+
|
17+
| If you have your views in other directories, you can change this array
18+
| in the way you need. All the paths in this array will be scanned for
19+
| new features.
20+
|
21+
*/
22+
23+
'scanned_paths' => [
24+
base_path('resources/views')
25+
],
26+
27+
/*
28+
|--------------------------------------------------------------------------
29+
| Scanned Features Default Status
30+
|--------------------------------------------------------------------------
31+
|
32+
| When you use the feature:scan command, new features could be added to the
33+
| system. Be default, this new features are disabled. You can change this
34+
| by setting this value to true instead of false.
35+
|
36+
| By doing so, new added features will be automatically enabled globally.
37+
|
38+
*/
39+
40+
'scanned_default_enabled' => true,
41+
42+
/*
43+
|--------------------------------------------------------------------------
44+
| Features Repository
45+
|--------------------------------------------------------------------------
46+
|
47+
| Here you can configure the concrete class you will use to work with
48+
| features. By default, this class is the EloquentFeatureRepository shipped
49+
| with this package. As the name says, it works with Eloquent.
50+
|
51+
| However, you can use a custom feature repository if you want, just by
52+
| creating a new class that implements the FeatureRepositoryInterface.
53+
|
54+
*/
55+
56+
'repository' => LaravelFeature\Repository\EloquentFeatureRepository::class
57+
58+
];
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
namespace Database\Seeders;
4+
5+
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
6+
use Illuminate\Database\Seeder;
7+
8+
class FeatureTableSeeder extends Seeder
9+
{
10+
public function run(): void
11+
{
12+
\Feature::add('premium', false);
13+
\Feature::add('badges', false);
14+
\Feature::add('podcasts', false);
15+
16+
\Feature::add('job_skills', false);
17+
\Feature::add('job_profile', false);
18+
\Feature::add('auth_login', false);
19+
\Feature::add('auth_social_login', false);
20+
21+
\Feature::add('sponsorship', false);
22+
\Feature::add('preview_feature', false);
23+
\Feature::add('view_profile', false);
24+
}
25+
}

public/css/app.css

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4376,6 +4376,15 @@ select {
43764376
.-m-3 {
43774377
margin: -0.75rem;
43784378
}
4379+
.m-2 {
4380+
margin: 0.5rem;
4381+
}
4382+
.m-0\.5 {
4383+
margin: 0.125rem;
4384+
}
4385+
.m-0 {
4386+
margin: 0px;
4387+
}
43794388
.my-10 {
43804389
margin-top: 2.5rem;
43814390
margin-bottom: 2.5rem;
@@ -4428,6 +4437,14 @@ select {
44284437
margin-left: 0px;
44294438
margin-right: 0px;
44304439
}
4440+
.mx-0\.5 {
4441+
margin-left: 0.125rem;
4442+
margin-right: 0.125rem;
4443+
}
4444+
.my-2 {
4445+
margin-top: 0.5rem;
4446+
margin-bottom: 0.5rem;
4447+
}
44314448
.mr-2 {
44324449
margin-right: 0.5rem;
44334450
}
@@ -4641,9 +4658,6 @@ select {
46414658
.h-5 {
46424659
height: 1.25rem;
46434660
}
4644-
.h-14 {
4645-
height: 3.5rem;
4646-
}
46474661
.h-12 {
46484662
height: 3rem;
46494663
}
@@ -4659,6 +4673,9 @@ select {
46594673
.h-32 {
46604674
height: 8rem;
46614675
}
4676+
.h-14 {
4677+
height: 3.5rem;
4678+
}
46624679
.h-10 {
46634680
height: 2.5rem;
46644681
}
@@ -4683,12 +4700,12 @@ select {
46834700
.h-4 {
46844701
height: 1rem;
46854702
}
4686-
.h-\[120px\] {
4687-
height: 120px;
4688-
}
46894703
.h-2 {
46904704
height: 0.5rem;
46914705
}
4706+
.h-\[120px\] {
4707+
height: 120px;
4708+
}
46924709
.h-64 {
46934710
height: 16rem;
46944711
}
@@ -4743,12 +4760,12 @@ select {
47434760
.w-5 {
47444761
width: 1.25rem;
47454762
}
4746-
.w-auto {
4747-
width: auto;
4748-
}
47494763
.w-14 {
47504764
width: 3.5rem;
47514765
}
4766+
.w-auto {
4767+
width: auto;
4768+
}
47524769
.w-8 {
47534770
width: 2rem;
47544771
}
@@ -4782,15 +4799,15 @@ select {
47824799
.w-60 {
47834800
width: 15rem;
47844801
}
4802+
.w-2 {
4803+
width: 0.5rem;
4804+
}
47854805
.w-3\/4 {
47864806
width: 75%;
47874807
}
47884808
.w-5\/6 {
47894809
width: 83.333333%;
47904810
}
4791-
.w-2 {
4792-
width: 0.5rem;
4793-
}
47944811
.w-12 {
47954812
width: 3rem;
47964813
}
@@ -5494,6 +5511,10 @@ select {
54945511
background-color: rgba(255, 255, 255, var(--tw-bg-opacity));
54955512
background-color: rgba(var(--color-menu-fill), var(--tw-bg-opacity));
54965513
}
5514+
.bg-orange-100 {
5515+
--tw-bg-opacity: 1;
5516+
background-color: rgba(255, 237, 213, var(--tw-bg-opacity));
5517+
}
54975518
.bg-red-50 {
54985519
--tw-bg-opacity: 1;
54995520
background-color: rgba(254, 242, 242, var(--tw-bg-opacity));
@@ -6141,6 +6162,14 @@ select {
61416162
--tw-text-opacity: 1;
61426163
color: rgba(88, 101, 242, var(--tw-text-opacity));
61436164
}
6165+
.text-orange-800 {
6166+
--tw-text-opacity: 1;
6167+
color: rgba(154, 52, 18, var(--tw-text-opacity));
6168+
}
6169+
.text-orange-400 {
6170+
--tw-text-opacity: 1;
6171+
color: rgba(251, 146, 60, var(--tw-text-opacity));
6172+
}
61446173
.text-red-400 {
61456174
--tw-text-opacity: 1;
61466175
color: rgba(248, 113, 113, var(--tw-text-opacity));
@@ -6243,6 +6272,10 @@ select {
62436272
--tw-text-opacity: 1;
62446273
color: rgba(127, 29, 29, var(--tw-text-opacity));
62456274
}
6275+
.text-sky-500 {
6276+
--tw-text-opacity: 1;
6277+
color: rgba(14, 165, 233, var(--tw-text-opacity));
6278+
}
62466279
.underline {
62476280
text-decoration-line: underline;
62486281
}

0 commit comments

Comments
 (0)