diff --git a/app/Console/Commands/OperationActivate.php b/app/Console/Commands/OperationActivate.php new file mode 100644 index 00000000..9d183a5e --- /dev/null +++ b/app/Console/Commands/OperationActivate.php @@ -0,0 +1,22 @@ +activate('operation'); + + $this->line('Activated'); + + return self::SUCCESS; + } +} diff --git a/app/Console/Commands/OperationDeactivate.php b/app/Console/Commands/OperationDeactivate.php new file mode 100644 index 00000000..3beef04e --- /dev/null +++ b/app/Console/Commands/OperationDeactivate.php @@ -0,0 +1,22 @@ +deactivate('operation'); + + $this->line('Deactivated'); + + return self::SUCCESS; + } +} diff --git a/app/Console/Commands/OperationStatus.php b/app/Console/Commands/OperationStatus.php new file mode 100644 index 00000000..7e3c1e59 --- /dev/null +++ b/app/Console/Commands/OperationStatus.php @@ -0,0 +1,22 @@ +when('operation', fn() => 'Active', fn() => 'Inactive'); + + $this->line($status); + + return self::SUCCESS; + } +} diff --git a/app/Features/Operation.php b/app/Features/Operation.php new file mode 100644 index 00000000..abe6b85b --- /dev/null +++ b/app/Features/Operation.php @@ -0,0 +1,18 @@ +name = 'operation'; + } + + public function resolve(): bool + { + return true; + } +} diff --git a/app/Providers/FeatureFlagsServiceProvider.php b/app/Providers/FeatureFlagsServiceProvider.php index af7c0acb..4fbae52a 100644 --- a/app/Providers/FeatureFlagsServiceProvider.php +++ b/app/Providers/FeatureFlagsServiceProvider.php @@ -2,6 +2,7 @@ namespace App\Providers; +use App\Features\Operation; use Illuminate\Support\ServiceProvider; use Laravel\Pennant\Feature; @@ -9,5 +10,6 @@ class FeatureFlagsServiceProvider extends ServiceProvider { public function boot(): void { + Feature::define(Operation::class); } } diff --git a/resources/views/inc/app/navigation-bar.blade.php b/resources/views/inc/app/navigation-bar.blade.php index c0b59bad..ee137fcb 100644 --- a/resources/views/inc/app/navigation-bar.blade.php +++ b/resources/views/inc/app/navigation-bar.blade.php @@ -5,15 +5,17 @@
  • Call us:+4222022
  • + @feature('operation')
  • - Sign up + Sign up
  • - Login + Login
  • - Track my order + Track my order
  • + @endfeature @@ -23,34 +25,36 @@
    -
    - +
    -
    + @csrf -
    +
    -
    - +
    +
    -
    -
    - - @guest - LOGIN - @endguest - @auth - Account - @endauth + @feature('operation') +
    +
    + + @guest + LOGIN + @endguest + @auth + Account + @endauth +
    -
    + @endfeature
    @@ -58,27 +62,27 @@