Skip to content

Enabled feature #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
use Illuminate\Notifications\Notification;
use Illuminate\Support\Facades\Auth;
use Laravel\Sanctum\HasApiTokens;
use LaravelFeature\Featurable\Featurable;
use LaravelFeature\Featurable\FeaturableInterface;
use QCod\Gamify\Gamify;
use Rinvex\Subscriptions\Traits\HasPlanSubscriptions;
use Spatie\MediaLibrary\HasMedia;
Expand All @@ -26,7 +28,7 @@
/**
* @mixin IdeHelperUser
*/
class User extends Authenticatable implements MustVerifyEmail, HasMedia
class User extends Authenticatable implements MustVerifyEmail, HasMedia, FeaturableInterface
{
use Gamify;
use HasFactory;
Expand All @@ -39,6 +41,7 @@ class User extends Authenticatable implements MustVerifyEmail, HasMedia
use InteractsWithMedia;
use Notifiable;
use Reacts;
use Featurable;

/**
* The attributes that are mass assignable.
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"blade-ui-kit/blade-ui-kit": "^0.3",
"cyrildewit/eloquent-viewable": "^6.1",
"doctrine/dbal": "^3.3",
"francescomalatesta/laravel-feature": "^3.0",
"fruitcake/laravel-cors": "^2.0",
"graham-campbell/markdown": "^14.0",
"guzzlehttp/guzzle": "^7.0.1",
Expand Down
69 changes: 68 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
* Package Service Providers...
*/
App\Providers\FortifyServiceProvider::class,
LaravelFeature\Provider\FeatureServiceProvider::class,

/*
* Application Service Providers...
Expand Down
58 changes: 58 additions & 0 deletions config/features.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Scanned Paths
|--------------------------------------------------------------------------
|
| You can easily add new features to the system with a simple call to the
| FeatureManager::add() method. However, as a bonus, you can also use
| the artisan feature:scan command.
|
| It will search for every view in resources/views path and add new
| features to the system starting from the @feature() directives in views.
|
| If you have your views in other directories, you can change this array
| in the way you need. All the paths in this array will be scanned for
| new features.
|
*/

'scanned_paths' => [
base_path('resources/views')
],

/*
|--------------------------------------------------------------------------
| Scanned Features Default Status
|--------------------------------------------------------------------------
|
| When you use the feature:scan command, new features could be added to the
| system. Be default, this new features are disabled. You can change this
| by setting this value to true instead of false.
|
| By doing so, new added features will be automatically enabled globally.
|
*/

'scanned_default_enabled' => true,

/*
|--------------------------------------------------------------------------
| Features Repository
|--------------------------------------------------------------------------
|
| Here you can configure the concrete class you will use to work with
| features. By default, this class is the EloquentFeatureRepository shipped
| with this package. As the name says, it works with Eloquent.
|
| However, you can use a custom feature repository if you want, just by
| creating a new class that implements the FeatureRepositoryInterface.
|
*/

'repository' => LaravelFeature\Repository\EloquentFeatureRepository::class

];
25 changes: 25 additions & 0 deletions database/seeders/FeatureTableSeeder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class FeatureTableSeeder extends Seeder
{
public function run(): void
{
\Feature::add('premium', false);
\Feature::add('badges', false);
\Feature::add('podcasts', false);

\Feature::add('job_skills', false);
\Feature::add('job_profile', false);
\Feature::add('auth_login', false);
\Feature::add('auth_social_login', false);

\Feature::add('sponsorship', false);
\Feature::add('preview_feature', false);
\Feature::add('view_profile', false);
}
}
57 changes: 45 additions & 12 deletions public/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -4376,6 +4376,15 @@ select {
.-m-3 {
margin: -0.75rem;
}
.m-2 {
margin: 0.5rem;
}
.m-0\.5 {
margin: 0.125rem;
}
.m-0 {
margin: 0px;
}
.my-10 {
margin-top: 2.5rem;
margin-bottom: 2.5rem;
Expand Down Expand Up @@ -4428,6 +4437,14 @@ select {
margin-left: 0px;
margin-right: 0px;
}
.mx-0\.5 {
margin-left: 0.125rem;
margin-right: 0.125rem;
}
.my-2 {
margin-top: 0.5rem;
margin-bottom: 0.5rem;
}
.mr-2 {
margin-right: 0.5rem;
}
Expand Down Expand Up @@ -4641,9 +4658,6 @@ select {
.h-5 {
height: 1.25rem;
}
.h-14 {
height: 3.5rem;
}
.h-12 {
height: 3rem;
}
Expand All @@ -4659,6 +4673,9 @@ select {
.h-32 {
height: 8rem;
}
.h-14 {
height: 3.5rem;
}
.h-10 {
height: 2.5rem;
}
Expand All @@ -4683,12 +4700,12 @@ select {
.h-4 {
height: 1rem;
}
.h-\[120px\] {
height: 120px;
}
.h-2 {
height: 0.5rem;
}
.h-\[120px\] {
height: 120px;
}
.h-64 {
height: 16rem;
}
Expand Down Expand Up @@ -4743,12 +4760,12 @@ select {
.w-5 {
width: 1.25rem;
}
.w-auto {
width: auto;
}
.w-14 {
width: 3.5rem;
}
.w-auto {
width: auto;
}
.w-8 {
width: 2rem;
}
Expand Down Expand Up @@ -4782,15 +4799,15 @@ select {
.w-60 {
width: 15rem;
}
.w-2 {
width: 0.5rem;
}
.w-3\/4 {
width: 75%;
}
.w-5\/6 {
width: 83.333333%;
}
.w-2 {
width: 0.5rem;
}
.w-12 {
width: 3rem;
}
Expand Down Expand Up @@ -5494,6 +5511,10 @@ select {
background-color: rgba(255, 255, 255, var(--tw-bg-opacity));
background-color: rgba(var(--color-menu-fill), var(--tw-bg-opacity));
}
.bg-orange-100 {
--tw-bg-opacity: 1;
background-color: rgba(255, 237, 213, var(--tw-bg-opacity));
}
.bg-red-50 {
--tw-bg-opacity: 1;
background-color: rgba(254, 242, 242, var(--tw-bg-opacity));
Expand Down Expand Up @@ -6141,6 +6162,14 @@ select {
--tw-text-opacity: 1;
color: rgba(88, 101, 242, var(--tw-text-opacity));
}
.text-orange-800 {
--tw-text-opacity: 1;
color: rgba(154, 52, 18, var(--tw-text-opacity));
}
.text-orange-400 {
--tw-text-opacity: 1;
color: rgba(251, 146, 60, var(--tw-text-opacity));
}
.text-red-400 {
--tw-text-opacity: 1;
color: rgba(248, 113, 113, var(--tw-text-opacity));
Expand Down Expand Up @@ -6243,6 +6272,10 @@ select {
--tw-text-opacity: 1;
color: rgba(127, 29, 29, var(--tw-text-opacity));
}
.text-sky-500 {
--tw-text-opacity: 1;
color: rgba(14, 165, 233, var(--tw-text-opacity));
}
.underline {
text-decoration-line: underline;
}
Expand Down
Loading