"ducsatthu/maxcms" : "0.1.*"
php artisan verdor:publish
php artisan migrate
{ | |
"name": "ducsatthu/maxcms", | |
"type": "library", | |
"description": ":This is my example for packager laravel", | |
"keywords": [ | |
"ducsatthu", | |
"maxcms" | |
], | |
"homepage": "https://github.com/ducsatthu/maxcms", | |
"license": "MIT", | |
"authors": [ | |
{ | |
"name": ":Tran Xuan Duc", | |
"email": ":ductranxuan.29710@gmail.com", | |
"role": "Developer" | |
} | |
], | |
"require": { | |
"illuminate/support": "~5.1", | |
"php" : "~5.5|~7.0" | |
}, | |
"require-dev": { | |
"phpunit/phpunit" : "4.*", | |
"scrutinizer/ocular": "~1.1", | |
"squizlabs/php_codesniffer": "~2.3" | |
}, | |
"autoload": { | |
"psr-4": { | |
"ducsatthu\\maxcms\\": "src" | |
} | |
}, | |
"autoload-dev": { | |
"psr-4": { | |
"ducsatthu\\maxcms\\": "tests" | |
} | |
} | |
} |
<?php | |
namespace ducsatthu\maxcms\Http\Controllers; | |
use App\Http\Controllers\Controller; | |
use Illuminate\Foundation\Auth\ResetsPasswords; | |
class MaxcmsController extends Controller | |
{ | |
public function action(){ | |
return view("maxcms::admin"); | |
} | |
} |
<?php | |
Route::get('/admin', 'MaxcmsController@action'); |
<?php | |
namespace ducsatthu\maxcms; | |
use Illuminate\Support\ServiceProvider; | |
class maxcmsServiceProvider extends ServiceProvider | |
{ | |
/** | |
* Perform post-registration booting of services. | |
* | |
* @return void | |
*/ | |
public function boot() | |
{ | |
$this->app->router->group(['namespace' => 'ducsatthu\maxcms\Http\Controllers'], | |
function(){ | |
require __DIR__.'/Http/routes.php'; | |
}); | |
$this->loadViewsFrom(base_path('MaxcmsThemes/views'), 'maxcms'); | |
$this->publishes([ | |
__DIR__ . '/views' => base_path('MaxcmsThemes/views') | |
]); | |
$this->publishes([ | |
__DIR__ . '/migrations' => database_path('/migrations') | |
], 'migrations'); | |
} | |
/** | |
* Register any package services. | |
* | |
* @return void | |
*/ | |
public function register() | |
{ | |
} | |
} |
<?php | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Database\Migrations\Migration; | |
class CreateMaxcmsSettingsTable extends Migration | |
{ | |
/** | |
* Run the migrations. | |
* | |
* @return void | |
*/ | |
public function up() | |
{ | |
Schema::create('maxcms_settings', function (Blueprint $table) { | |
$table->increments('id'); | |
$table->timestamps(); | |
}); | |
} | |
/** | |
* Reverse the migrations. | |
* | |
* @return void | |
*/ | |
public function down() | |
{ | |
Schema::drop('maxcms_settings'); | |
} | |
} |
<?php | |
echo "this is test"; |