Skip to content

Commit 1bd3825

Browse files
authored
Initialize Laravel WooCommerce
1 parent 0024441 commit 1bd3825

File tree

6 files changed

+135
-2
lines changed

6 files changed

+135
-2
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# laravel-woocommerce
2-
WooCommerce Rest API with Laravel
1+
# laravel-woocommerce
2+
WooCommerce Rest API with Laravel

composer.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "codexshaper/woocommerce",
3+
"description": "WooCommerce Rest API with Laravel",
4+
"type": "library",
5+
"require": {
6+
"automattic/woocommerce": "^3.0"
7+
},
8+
"license": "MIT",
9+
"authors": [
10+
{
11+
"name": "Md Abu Ahsan Basir",
12+
"email": "maab.career@gmail.com"
13+
}
14+
],
15+
"minimum-stability": "stable",
16+
"autoload": {
17+
"psr-4": {
18+
"Codexshaper\\Woocommerce\\": "src/"
19+
}
20+
}
21+
}

composer.lock

+66
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/WooCommerceServiceProvider.php

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
namespace Codexshaper\Woocommerce;
4+
5+
use Illuminate\Support\ServiceProvider;
6+
7+
class WooCommerceServiceProvider extends ServiceProvider
8+
{
9+
10+
/**
11+
* Boot the service provider.
12+
*
13+
* @return void
14+
*/
15+
public function boot()
16+
{
17+
$this->loadRoutesFrom(__DIR__.'/routes.php');
18+
$this->mergeConfigFrom(
19+
__DIR__.'/config/woocommerce.php', 'laravel-woocommerce'
20+
);
21+
$this->publishes([
22+
__DIR__.'/config/woocommerce.php' => config_path('woocommerce.php'),
23+
],'laravel-woocommerce');
24+
}
25+
26+
/**
27+
* Register the service provider.
28+
*
29+
* @return void
30+
*/
31+
public function register()
32+
{
33+
34+
}
35+
}

src/config/woocommerce.php

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
3+
return [
4+
'WOOCOOMERCE_CONSUMER_KEY' => env('WOOCOOMERCE_CONSUMER_KEY', ''),
5+
'WOOCOOMERCE_CONSUMER_SECRET' => env('WOOCOOMERCE_CONSUMER_SECRET', ''),
6+
];

src/routes.php

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
Route::get('test', function(){
4+
return "Test";
5+
});

0 commit comments

Comments
 (0)