Skip to content

Commit

Permalink
laravel zain dev
Browse files Browse the repository at this point in the history
  • Loading branch information
alkhatibdev committed Jul 13, 2022
0 parents commit dce42a3
Show file tree
Hide file tree
Showing 7 changed files with 406 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Laravel Zain

Zain DSP API integration with laravel

## Documentation coming soon
27 changes: 27 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "alkhatibdev/laravel-zain",
"description": "Zain DSP API integration",
"type": "package",
"license": "MIT",
"authors": [
{
"name": "AlkhatibHamad",
"email": "alkhatib.hamad@gmail.com"
}
],
"minimum-stability": "dev",
"require": {},
"autoload": {
"psr-4": {
"AlkhatibDev\\LaravelZain\\": "src/"
}
},
"extra": {
"laravel": {
"providers": [
"AlkhatibDev\\LaravelZain\\LaravelZainServiceProvider"
]

}
}
}
17 changes: 17 additions & 0 deletions config/laravel-zain.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

return [

'base_url' => env('ZAIN_SERVER_BASE_API_URL'),

'product_code' => env('ZAIN_PRODUCT_CODE'),

'username' => env('ZAIN_USERNAME'),

'password' => env('ZAIN_PASSWORD'),

'remember_token' => env('ZAIN_REMEMBER_TOKEN', false),

'enable_logging' => false,

];
7 changes: 7 additions & 0 deletions src/Exceptions/InvlalidConfigsValuesException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace AlkhatibDev\LaravelZain\Exceptions;

use Exception;

class InvlalidConfigsValuesException extends Exception {}
19 changes: 19 additions & 0 deletions src/Facades/Zain.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace AlkhatibDev\LaravelZain\Facades;

use Illuminate\Support\Facades\Facade;

class Zain extends Facade {

/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor()
{
return 'Zain';
}

}
41 changes: 41 additions & 0 deletions src/LaravelZainServiceProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

namespace AlkhatibDev\LaravelZain;

use Illuminate\Support\ServiceProvider;

class LaravelZainServiceProvider extends ServiceProvider {

/**
* Register any application services.
*
* @return void
*/
public function register()
{

$this->app->singleton('Zain', function ($app) {
return new \AlkhatibDev\LaravelZain\Zain();
});

}

/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
$this->publishResources();
}

protected function publishResources()
{
// Publish Configs
$this->publishes([
__DIR__.'/../config/laravel-zain.php' => config_path('laravel-zain.php'),
], 'laravel-zain-config');
}

}

0 comments on commit dce42a3

Please sign in to comment.