re-add missing stub files

This commit is contained in:
Nabeel Shahzad 2017-12-13 22:24:41 -06:00
parent 346ccfbd66
commit a3ec21c73d
42 changed files with 1250 additions and 0 deletions

View File

@ -0,0 +1,68 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class $CLASS$ extends Command
{
/**
* The console command name.
*
* @var string
*/
protected $name = '$COMMAND_NAME$';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description.';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
//
}
/**
* Get the console command arguments.
*
* @return array
*/
protected function getArguments()
{
return [
['example', InputArgument::REQUIRED, 'An example argument.'],
];
}
/**
* Get the console command options.
*
* @return array
*/
protected function getOptions()
{
return [
['example', null, InputOption::VALUE_OPTIONAL, 'An example option.', null],
];
}
}

View File

@ -0,0 +1,26 @@
{
"name": "$VENDOR$/$LOWER_NAME$",
"description": "",
"authors": [
{
"name": "$AUTHOR_NAME$",
"email": "$AUTHOR_EMAIL$"
}
],
"extra": {
"laravel": {
"providers": [
"$MODULE_NAMESPACE$\\$STUDLY_NAME$\\Providers\\$STUDLY_NAME$ServiceProvider",
"$MODULE_NAMESPACE$\\$STUDLY_NAME$\\Providers\\EventServiceProvider"
],
"aliases": {
}
}
},
"autoload": {
"psr-4": {
"$MODULE_NAMESPACE$\\$STUDLY_NAME$\\": ""
}
}
}

View File

@ -0,0 +1,63 @@
<?php
namespace $MODULE_NAMESPACE$\$STUDLY_NAME$\Http\Controllers;
use App\Http\Controllers\AppBaseController;
use Illuminate\Http\Request;
class AdminController extends AppBaseController
{
/**
* Display a listing of the resource.
*/
public function index()
{
return view('$LOWER_NAME$::admin.index');
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
return view('$LOWER_NAME$::admin.create');
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
}
/**
* Show the specified resource.
*/
public function show()
{
return view('$LOWER_NAME$::admin.show');
}
/**
* Show the form for editing the specified resource.
*/
public function edit()
{
return view('$LOWER_NAME$::admin.edit');
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request)
{
}
/**
* Remove the specified resource from storage.
*/
public function destroy()
{
}
}

View File

@ -0,0 +1,9 @@
<?php
namespace $CLASS_NAMESPACE$;
use Illuminate\Routing\Controller;
class $CLASS$ extends Controller
{
}

View File

@ -0,0 +1,64 @@
<?php
namespace $CLASS_NAMESPACE$;
use App\Http\Controllers\AppBaseController;
use Illuminate\Http\Request;
class $CLASS$ extends AppBaseController
{
/**
* Display a listing of the resource.
*/
public function index()
{
return view('$LOWER_NAME$::index');
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
return view('$LOWER_NAME$::create');
}
/**
* Store a newly created resource in storage.
* @param Request $request
*/
public function store(Request $request)
{
}
/**
* Show the specified resource.
*/
public function show()
{
return view('$LOWER_NAME$::show');
}
/**
* Show the form for editing the specified resource.
*/
public function edit()
{
return view('$LOWER_NAME$::edit');
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request)
{
}
/**
* Remove the specified resource from storage.
*/
public function destroy()
{
}
}

View File

@ -0,0 +1,25 @@
<?php
namespace $MODULE_NAMESPACE$\$STUDLY_NAME$\Providers;
use App\Events\TestEvent;
use $MODULE_NAMESPACE$\$STUDLY_NAME$\Listeners\TestEventListener;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
class EventServiceProvider extends ServiceProvider
{
/**
* The event listener mappings for the application.
*/
protected $listen = [
TestEvent::class => [TestEventListener::class],
];
/**
* Register any events for your application.
*/
public function boot()
{
parent::boot();
}
}

View File

@ -0,0 +1,30 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Queue\SerializesModels;
class $CLASS$
{
use SerializesModels;
/**
* Create a new event instance.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Get the channels the event should be broadcast on.
*
* @return array
*/
public function broadcastOn()
{
return [];
}
}

View File

@ -0,0 +1,9 @@
<?php
use Faker\Generator as Faker;
$factory->define(Model::class, function (Faker $faker) {
return [
//
];
});

View File

@ -0,0 +1,34 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
class $CLASS$ implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
/**
* Create a new job instance.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
//
}
}

View File

@ -0,0 +1,31 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Bus\Queueable;
use Illuminate\Foundation\Bus\Dispatchable;
class $CLASS$ implements ShouldQueue
{
use Dispatchable, Queueable;
/**
* Create a new job instance.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
//
}
}

View File

@ -0,0 +1,15 @@
{
"name": "$STUDLY_NAME$",
"alias": "$LOWER_NAME$",
"description": "",
"keywords": [],
"active": 1,
"order": 0,
"providers": [
"$MODULE_NAMESPACE$\\$STUDLY_NAME$\\Providers\\$STUDLY_NAME$ServiceProvider",
"$MODULE_NAMESPACE$\\$STUDLY_NAME$\\Providers\\EventServiceProvider"
],
"aliases": {},
"files": [],
"requires": []
}

View File

@ -0,0 +1,30 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
class $CLASS$
{
/**
* Create the event listener.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Handle the event.
*
* @param object $event
* @return void
*/
public function handle($event)
{
//
}
}

View File

@ -0,0 +1,32 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
class $CLASS$ implements ShouldQueue
{
use InteractsWithQueue;
/**
* Create the event listener.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Handle the event.
*
* @param object $event
* @return void
*/
public function handle($event)
{
//
}
}

View File

@ -0,0 +1,33 @@
<?php
namespace $NAMESPACE$;
use $EVENTNAME$;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
class $CLASS$ implements ShouldQueue
{
use InteractsWithQueue;
/**
* Create the event listener.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Handle the event.
*
* @param $SHORTEVENTNAME$ $event
* @return void
*/
public function handle($SHORTEVENTNAME$ $event)
{
//
}
}

View File

@ -0,0 +1,16 @@
<?php
namespace $MODULE_NAMESPACE$\$STUDLY_NAME$\Listeners;
use App\Events\TestEvent;
use Log;
class TestEventListener
{
/**
* Handle the event.
*/
public function handle(TestEvent $event) {
Log::info('Received event', [$event]);
}
}

View File

@ -0,0 +1,31 @@
<?php
namespace $NAMESPACE$;
use $EVENTNAME$;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
class $CLASS$
{
/**
* Create the event listener.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Handle the event.
*
* @param $SHORTEVENTNAME$ $event
* @return void
*/
public function handle($SHORTEVENTNAME$ $event)
{
//
}
}

View File

@ -0,0 +1,33 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class $CLASS$ extends Mailable
{
use Queueable, SerializesModels;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->view('view.name');
}
}

View File

@ -0,0 +1,21 @@
<?php
namespace $NAMESPACE$;
use Closure;
use Illuminate\Http\Request;
class $CLASS$
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle(Request $request, Closure $next)
{
return $next($request);
}
}

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class $CLASS$ extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('$TABLE$', function (Blueprint $table) {
$FIELDS_UP$
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('$TABLE$', function (Blueprint $table) {
$FIELDS_DOWN$
});
}
}

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class $CLASS$ extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('$TABLE$', function (Blueprint $table) {
$table->increments('id');
$FIELDS$
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('$TABLE$');
}
}

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class $CLASS$ extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('$TABLE$', function (Blueprint $table) {
$FIELDS_UP$
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('$TABLE$', function (Blueprint $table) {
$FIELDS_DOWN$
});
}
}

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class $CLASS$ extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::dropIfExists('$TABLE$');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::create('$TABLE$', function (Blueprint $table) {
$table->increments('id');
$FIELDS$
$table->timestamps();
});
}
}

View File

@ -0,0 +1,28 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class $CLASS$ extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}

View File

@ -0,0 +1,10 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Database\Eloquent\Model;
class $CLASS$ extends Model
{
protected $fillable = $FILLABLE$;
}

View File

@ -0,0 +1,61 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
class $CLASS$ extends Notification
{
use Queueable;
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return ['mail'];
}
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)
->line('The introduction to the notification.')
->action('Notification Action', 'https://laravel.com')
->line('Thank you for using our application!');
}
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @return array
*/
public function toArray($notifiable)
{
return [
//
];
}
}

View File

@ -0,0 +1,20 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Auth\Access\HandlesAuthorization;
class $CLASS$
{
use HandlesAuthorization;
/**
* Create a new policy instance.
*
* @return void
*/
public function __construct()
{
//
}
}

View File

@ -0,0 +1,35 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Support\ServiceProvider;
class $CLASS$ extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
//
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return [];
}
}

View File

@ -0,0 +1,30 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Foundation\Http\FormRequest;
class $CLASS$ extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
//
];
}
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
}

View File

@ -0,0 +1,19 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Http\Resources\Json\ResourceCollection;
class $CLASS$ extends ResourceCollection
{
/**
* Transform the resource collection into an array.
*
* @param \Illuminate\Http\Request
* @return array
*/
public function toArray($request)
{
return parent::toArray($request);
}
}

View File

@ -0,0 +1,19 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Http\Resources\Json\Resource;
class $CLASS$ extends Resource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request
* @return array
*/
public function toArray($request)
{
return parent::toArray($request);
}
}

View File

@ -0,0 +1,41 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Routing\Router;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class $CLASS$ extends ServiceProvider
{
/**
* The root namespace to assume when generating URLs to actions.
*
* @var string
*/
protected $rootUrlNamespace = '$MODULE_NAMESPACE$\$MODULE$\Http\Controllers';
/**
* Called before routes are registered.
*
* Register any model bindings or pattern based filters.
*
* @param Router $router
* @return void
*/
public function before(Router $router)
{
//
}
/**
* Define the routes for the application.
*
* @return void
*/
public function map(Router $router)
{
// if (!app()->routesAreCached()) {
// require __DIR__ . '$ROUTES_PATH$';
// }
}
}

View File

@ -0,0 +1,18 @@
<?php
Route::group(['middleware' => [
'role:admin|user' # leave blank to make this public
]], function() {
# all your routes are prefixed with the above prefix
# e.g. yoursite.com/sample
Route::get('/', '$STUDLY_NAME$Controller@index');
# This is the admin path. Comment this out if you don't have
# an admin panel component.
Route::group([
'middleware' => ['role:admin'],
], function () {
Route::get('/admin', 'AdminController@index');
});
});

View File

@ -0,0 +1,40 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Contracts\Validation\Rule;
class $CLASS$ implements Rule
{
/**
* Create a new rule instance.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Determine if the validation rule passes.
*
* @param string $attribute
* @param mixed $value
* @return bool
*/
public function passes($attribute, $value)
{
//
}
/**
* Get the validation error message.
*
* @return string
*/
public function message()
{
return 'The validation error message.';
}
}

View File

@ -0,0 +1,5 @@
<?php
return [
'name' => '$STUDLY_NAME$'
];

View File

@ -0,0 +1,132 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Support\ServiceProvider;
use Illuminate\Database\Eloquent\Factory;
use Route;
class $CLASS$ extends ServiceProvider
{
protected $defer = false;
protected $moduleSvc;
/**
* Boot the application events.
*/
public function boot()
{
$this->moduleSvc = app('App\Services\ModuleService');
$this->registerRoutes();
$this->registerTranslations();
$this->registerConfig();
$this->registerViews();
$this->registerLinks();
$this->registerFactories();
$this->loadMigrationsFrom(__DIR__ . '/../$MIGRATIONS_PATH$');
}
/**
* Register the service provider.
*/
public function register()
{
//
}
/**
* Add module links here
*/
public function registerLinks()
{
// Show this link if logged in
// $this->moduleSvc->addFrontendLink('$STUDLY_NAME$', '/$LOWER_NAME$', '', $logged_in=true);
// Admin links:
$this->moduleSvc->addAdminLink('$STUDLY_NAME$', '/$LOWER_NAME$/admin');
}
/**
* Register the routes
*/
protected function registerRoutes()
{
Route::group([
'as' => '$LOWER_NAME$.',
'prefix' => '$LOWER_NAME$',
// If you want a RESTful module, change this to 'api'
'middleware' => ['web'],
'namespace' => '$MODULE_NAMESPACE$\$STUDLY_NAME$\Http\Controllers'
], function() {
$this->loadRoutesFrom(__DIR__ . '/../Http/routes.php');
});
}
/**
* Register config.
*/
protected function registerConfig()
{
$this->publishes([
__DIR__.'/../$PATH_CONFIG$/config.php' => config_path('$LOWER_NAME$.php'),
], 'config');
$this->mergeConfigFrom(
__DIR__.'/../$PATH_CONFIG$/config.php', '$LOWER_NAME$'
);
}
/**
* Register views.
*/
public function registerViews()
{
$viewPath = resource_path('views/modules/$LOWER_NAME$');
$sourcePath = __DIR__.'/../$PATH_VIEWS$';
$this->publishes([
$sourcePath => $viewPath
],'views');
$this->loadViewsFrom(array_merge(array_map(function ($path) {
return $path . '/modules/$LOWER_NAME$';
}, \Config::get('view.paths')), [$sourcePath]), '$LOWER_NAME$');
}
/**
* Register translations.
*/
public function registerTranslations()
{
$langPath = resource_path('lang/modules/$LOWER_NAME$');
if (is_dir($langPath)) {
$this->loadTranslationsFrom($langPath, '$LOWER_NAME$');
} else {
$this->loadTranslationsFrom(__DIR__ .'/../$PATH_LANG$', '$LOWER_NAME$');
}
}
/**
* Register an additional directory of factories.
* @source https://github.com/sebastiaanluca/laravel-resource-flow/blob/develop/src/Modules/ModuleServiceProvider.php#L66
*/
public function registerFactories()
{
if (! app()->environment('production')) {
app(Factory::class)->load(__DIR__ . '/../$FACTORIES_PATH$');
}
}
/**
* Get the services provided by the provider.
*/
public function provides()
{
return [];
}
}

View File

@ -0,0 +1,21 @@
<?php
namespace $NAMESPACE$\Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
class $NAME$ extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
// $this->call("OthersTableSeeder");
}
}

View File

@ -0,0 +1,17 @@
<?php
/*
|--------------------------------------------------------------------------
| Register Namespaces And Routes
|--------------------------------------------------------------------------
|
| When a module starting, this file will executed automatically. This helps
| to register some namespaces like translator or view. Also this file
| will load the routes file for each module. You may also modify
| this file as you want.
|
*/
/*if (!app()->routesAreCached()) {
require __DIR__ . '$ROUTES_LOCATION$';
}*/

View File

@ -0,0 +1,19 @@
<?php
namespace $NAMESPACE$;
use Tests\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
class $CLASS$ extends TestCase
{
/**
* A basic test example.
*
* @return void
*/
public function testExample()
{
$this->assertTrue(true);
}
}

View File

@ -0,0 +1,5 @@
{{--
You probably don't want to edit anything here. Just make
sure to extend this in your views. It will pass the content section through
--}}
@extends('admin.app')

View File

@ -0,0 +1,5 @@
{{--
You probably don't want to edit anything here. Just make
sure to extend this in your views. It will pass the content section through
--}}
@extends('layouts.' . config('phpvms.skin') . '.app')

View File

@ -0,0 +1,18 @@
@extends('$LOWER_NAME$::layouts.admin')
@section('title', '$STUDLY_NAME$')
@section('actions')
<li>
<a href="{!! url('/$LOWER_NAME$/admin/create') !!}">
<i class="ti-plus"></i>
Add New</a>
</li>
@endsection
@section('content')
<div class="card border-blue-bottom">
<div class="header"><h4 class="title">Admin Scaffold!</h4></div>
<div class="content">
<p>This view is loaded from module: {!! config('$LOWER_NAME$.name') !!}</p>
</div>
</div>
@endsection

View File

@ -0,0 +1,9 @@
@extends('$LOWER_NAME$::layouts.frontend')
@section('content')
<h1>Hello World</h1>
<p>
This view is loaded from module: {!! config('$LOWER_NAME$.name') !!}
</p>
@endsection