This commit is contained in:
aliqasemi 2024-01-17 19:05:38 +03:30
parent 871fd53694
commit 33e8091a34
8 changed files with 40 additions and 40 deletions

View File

@ -21,7 +21,7 @@
"IICN\\Subscription\\SubscriptionServiceProvider" "IICN\\Subscription\\SubscriptionServiceProvider"
], ],
"aliases": { "aliases": {
"Subscription": "IICN\\Subscription\\Facades\\Subscription" "Subscription": "IICN\\Subscription\\Subscription"
} }
} }
}, },

View File

@ -11,7 +11,7 @@ return new class extends Migration
*/ */
public function up(): void public function up(): void
{ {
Schema::create('subscription_abilities', function (Blueprint $table) { Schema::create('subscription_logs', function (Blueprint $table) {
$table->id(); $table->id();
$table->unsignedBigInteger('subscription_ability_id'); $table->unsignedBigInteger('subscription_ability_id');
$table->unsignedBigInteger('user_id'); $table->unsignedBigInteger('user_id');
@ -25,6 +25,6 @@ return new class extends Migration
*/ */
public function down(): void public function down(): void
{ {
Schema::dropIfExists('subscription_abilities'); Schema::dropIfExists('subscription_logs');
} }
}; };

View File

@ -1,7 +1,7 @@
<?php <?php
Route::prefix('api/v1/subscription')->group(function () { Route::prefix('api/v1/subscription')->group(function () {
Route::namespace("IICN\Subscription\Controllers")->group(function () { Route::namespace("IICN\Subscription\Http\Controllers")->group(function () {
Route::namespace('Test')->group(function () { Route::namespace('Test')->group(function () {
Route::get('test', 'Test'); Route::get('test', 'Test');

View File

@ -1,19 +0,0 @@
<?php
namespace IICN\Subscription\Facades;
use Illuminate\Support\Facades\Facade;
/**
* @method static \IICN\Subscription\Subscription used(string $type)
* @method static \IICN\Subscription\Subscription canUse(string $type)
* @method static \IICN\Subscription\Subscription rollback(string $type)
*
* @see \IICN\Subscription\Subscription
*/
class Subscription extends Facade
{
protected static function getFacadeAccessor()
{
return 'subscription';
}
}

View File

@ -3,7 +3,7 @@
namespace IICN\Subscription\Http\Controllers\Test; namespace IICN\Subscription\Http\Controllers\Test;
use IICN\Subscription\Http\Controllers\Controller; use IICN\Subscription\Http\Controllers\Controller;
use IICN\Subscription\Facades\Subscription; use IICN\Subscription\Subscription;
class Test extends Controller class Test extends Controller
{ {

View File

@ -0,0 +1,22 @@
<?php
namespace IICN\Subscription\Services;
class Subscription
{
public function used($type)
{
return "Hello, Greetings";
}
public function canUse($type)
{
return "Hello, Greetings";
}
public function rollback($type)
{
return "Hello, Greetings";
}
}

View File

@ -1,22 +1,19 @@
<?php <?php
namespace IICN\Subscription; namespace IICN\Subscription;
class Subscription use Illuminate\Support\Facades\Facade;
{
public function used($type)
{
return "Hello, Greetings";
}
/**
public function canUse($type) * @method static \IICN\Subscription\Services\Subscription used(string $type)
* @method static \IICN\Subscription\Services\Subscription canUse(string $type)
* @method static \IICN\Subscription\Services\Subscription rollback(string $type)
*
* @see \IICN\Subscription\Services\Subscription
*/
class Subscription extends Facade
{ {
return "Hello, Greetings"; protected static function getFacadeAccessor()
}
public function rollback($type)
{ {
return "Hello, Greetings"; return 'subscription';
} }
} }

View File

@ -34,7 +34,7 @@ class SubscriptionServiceProvider extends ServiceProvider
); );
$this->app->bind('subscription',function(){ $this->app->bind('subscription',function(){
return new Subscription(); return new \IICN\Subscription\Services\Subscription();
}); });
} }