forked from nishangupta/Mart
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
187 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace App\Console\Commands; | ||
|
||
use Illuminate\Console\Command; | ||
use Laravel\Pennant\FeatureManager; | ||
|
||
class OperationActivate extends Command | ||
{ | ||
protected $signature = 'app:operation:activate'; | ||
|
||
protected $description = 'Activate operation'; | ||
|
||
public function handle(FeatureManager $feature): int | ||
{ | ||
$feature->activate('operation'); | ||
|
||
$this->line('Activated'); | ||
|
||
return self::SUCCESS; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace App\Console\Commands; | ||
|
||
use Illuminate\Console\Command; | ||
use Laravel\Pennant\FeatureManager; | ||
|
||
class OperationDeactivate extends Command | ||
{ | ||
protected $signature = 'app:operation:deactivate'; | ||
|
||
protected $description = 'Deactivate operation'; | ||
|
||
public function handle(FeatureManager $feature): int | ||
{ | ||
$feature->deactivate('operation'); | ||
|
||
$this->line('Deactivated'); | ||
|
||
return self::SUCCESS; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace App\Console\Commands; | ||
|
||
use Illuminate\Console\Command; | ||
use Laravel\Pennant\FeatureManager; | ||
|
||
class OperationStatus extends Command | ||
{ | ||
protected $signature = 'app:operation:status'; | ||
|
||
protected $description = 'Check operation status'; | ||
|
||
public function handle(FeatureManager $feature): int | ||
{ | ||
$status = $feature->when('operation', fn() => 'Active', fn() => 'Inactive'); | ||
|
||
$this->line($status); | ||
|
||
return self::SUCCESS; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace App\Features; | ||
|
||
class Operation | ||
{ | ||
public readonly string $name; | ||
|
||
public function __construct() | ||
{ | ||
$this->name = 'operation'; | ||
} | ||
|
||
public function resolve(): bool | ||
{ | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.