sohead / core
A core package for Sohead with laravel 5.8
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 2 068
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 1
Requires
- abraham/twitteroauth: ^1.1
- facebook/graph-sdk: ^5.7
- facebook/php-business-sdk: 3.1.*
- firebase/php-jwt: ^5.0
- gmostafa/php-graphql-client: ^1.4
- google/apiclient: ^2.0
- guzzlehttp/guzzle: ^6.5
- dev-master
- v1.2.9
- v1.2.8
- v1.2.7
- v1.2.6
- v1.2.5
- v1.2.4
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.9
- v1.1.7
- v1.1.6
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- dev-rating
- dev-sohead_admin_es
- dev-develop
- dev-social_shop
- dev-new_widget_function
- dev-intagram
- dev-user_info
- dev-fix_customer_shopify
- dev-newprice
- dev-social_publish
- dev-hackathong
- dev-add_test_env
- dev-remove_app_version_check
- dev-fix_schedule
- dev-handle-shop-update
This package is auto-updated.
Last update: 2020-11-12 04:49:28 UTC
README
Install
composer require sohead/core
Configuration
Setup middle cors for api
Add to $middleware in Kernel
protected $middleware = [ ... \Sohead\Core\Http\Middleware\Cors::class, ]
Publish config file
php artisan vendor:publish --provider="Sohead\Core\SoheadProvider"
Add database configuration
Add to config database
'connections' => [ ... 'sohead_core' => [ 'driver' => 'pgsql', 'url' => env('DATABASE_URL'), 'host' => env('DB_CORE_HOST', '127.0.0.1'), 'port' => env('DB_CORE_PORT', '5432'), 'database' => env('DB_CORE_DATABASE', 'forge'), 'username' => env('DB_CORE_USERNAME', 'forge'), 'password' => env('DB_CORE_PASSWORD', ''), 'charset' => 'utf8', 'prefix' => '', 'prefix_indexes' => true, 'schema' => 'public', 'sslmode' => 'prefer', ], ]
Add to env
APP_ID= FRONTEND_URL= DB_CORE_HOST= DB_CORE_PORT= DB_CORE_DATABASE= DB_CORE_USERNAME= DB_CORE_PASSWORD= SPF_API_KEY= SPF_SECRET_KEY= FACEBOOK_KEY= FACEBOOK_SECRET= GOOGLE_KEY= GOOGLE_SECRET=
Add to function schedule in Kernel
$schedule->command('shopify:sync_collection_product')->everyFiveMinutes();
How to use
Route has been identified
Method | URI | Action | Middleware |
---|---|---|---|
GET | api/app/user | Sohead\Core\Http\Controllers\Api\AppController@userInfo | sohead.auth |
GET | api/shopify/auth_handle | Sohead\Core\Http\Controllers\Api\ShopifyController@auth | |
POST | api/shopify/charge | Sohead\Core\Http\Controllers\Api\ShopifyController@charge | sohead.auth |
GET | api/shopify/charge_handle | Sohead\Core\Http\Controllers\Api\ShopifyController@chargeHandle | |
POST | api/shopify/generate_url | Sohead\Core\Http\Controllers\Api\ShopifyController@getAuthUrl | |
POST | api/shopify/webhook | Sohead\Core\Http\Controllers\Api\ShopifyController@webhook | shopify.webhook |
POST | api/social/account | Sohead\Core\Http\Controllers\Api\SocialController@saveAccount | sohead.auth |
GET | api/social/auth_handle | Sohead\Core\Http\Controllers\Api\SocialController@authHandle | sohead.redirect |
POST | api/social/generate_url | Sohead\Core\Http\Controllers\Api\SocialController@getAuthUrl | sohead.auth |
GET | api/social/previewMetaData | Sohead\Core\Http\Controllers\Api\SocialController@previewMetaData | |
POST | api/social/re-auth | Sohead\Core\Http\Controllers\Api\SocialController@reconnect | sohead.auth |
Social Support
Middleware
- sohead.auth : check Authorization
- shopify.webhook : Shopify Authenticate Hook
Queue
- AddWebhook (init_app)
- SyncProducts (shopify_sync_products)
- SyncCollections (shopify_sync_collections)
- SyncCollectionProducts (shopify_sync_collection_product)
How to customize
App install Shopify handle auth
Add singleton to function boot in AppServiceProvider
$this->app->singleton( \Sohead\Core\Services\Contracts\AppService::class, \App\Services\AppService::class );
File AppService need extend class core
\Sohead\Core\Services\AppService
Then you can customize logic function
Charge Handle
Create listener Charge Handle document
php artisan make:listener ChargeHandle
Add to $listen in EventServiceProvider
protected $listen = [ ... \Sohead\Core\Events\ChargeHandle::class => [ \App\Listeners\ChargeHandle::class, ], ];
Then you can customize logic Charge Handle
Shopify hook
Create listener ShopifyHook document
php artisan make:listener ShopifyHook
Add to $listen in EventServiceProvider
protected $listen = [ ... \Sohead\Core\Events\ShopifyHook::class => [ \App\Listeners\ShopifyHook::class, ], ];
Then you can customize logic wehhook
Api Social
Add singleton to function boot in AppServiceProvider
$this->app->singleton( \Sohead\Core\Services\Contracts\SocialService::class, \App\Services\SocialService::class );
File SocialService need extend class core
\Sohead\Core\Services\SocialService
Then you can customize logic function