Skip to content

Instantly share code, notes, and snippets.

@ducsatthu
Last active November 17, 2017 11:00
Show Gist options
  • Save ducsatthu/abe0740c388a84a9107c1a51ec884214 to your computer and use it in GitHub Desktop.
Save ducsatthu/abe0740c388a84a9107c1a51ec884214 to your computer and use it in GitHub Desktop.
this package
{
"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"
}
}
}

Max CMS

Install

"ducsatthu/maxcms" : "0.1.*"

Usage

php artisan verdor:publish
php artisan migrate
<?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";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment