add swiftpayments from old source
This commit is contained in:
49
app/Console/Commands/stubs/make-module/controller.stub
Normal file
49
app/Console/Commands/stubs/make-module/controller.stub
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace $NAMESPACE$;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class $CONTROLLER_NAME$ extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index(Request $request): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(Request $request): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(Request $request): void
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
27
app/Console/Commands/stubs/make-module/migration.stub
Executable file
27
app/Console/Commands/stubs/make-module/migration.stub
Executable file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('{{ table }}', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('{{ table }}');
|
||||
}
|
||||
};
|
||||
11
app/Console/Commands/stubs/make-module/model.stub
Normal file
11
app/Console/Commands/stubs/make-module/model.stub
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace $NAMESPACE$;
|
||||
|
||||
use Illuminate\Database\Eloquent\Concerns\HasUuids;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class $CLASS_NAME$ extends Model
|
||||
{
|
||||
use HasUuids;
|
||||
}
|
||||
74
app/Console/Commands/stubs/make-module/nova-resource.stub
Normal file
74
app/Console/Commands/stubs/make-module/nova-resource.stub
Normal file
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
namespace $NAMESPACE$;
|
||||
|
||||
use App\Nova\Resource;
|
||||
use Laravel\Nova\Fields\ID;
|
||||
use Laravel\Nova\Http\Requests\NovaRequest;
|
||||
|
||||
/**
|
||||
* @template TModel of \$MODEL_NAMESPACE$
|
||||
*
|
||||
* @extends Resource<TModel>
|
||||
*/
|
||||
class $RESOURCE_NAME_SINGULAR$ extends Resource
|
||||
{
|
||||
/**
|
||||
* The model the resource corresponds to.
|
||||
*
|
||||
* @var class-string<\$MODEL_NAMESPACE$>
|
||||
*/
|
||||
public static $model = \$MODEL_NAMESPACE$::class;
|
||||
|
||||
/**
|
||||
* The single value that should be used to represent the resource when being displayed.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public static $title = 'id';
|
||||
|
||||
/**
|
||||
* The columns that should be searched.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
public static $search = [
|
||||
'id',
|
||||
];
|
||||
|
||||
/**
|
||||
* The relationships that should be eager loaded on index queries.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
// public static $with = [];
|
||||
|
||||
/**
|
||||
* Get the displayable label of the resource.
|
||||
*/
|
||||
public static function label(): string
|
||||
{
|
||||
return __('$MODEL_NAME_PLURAL$');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the displayable singular label of the resource.
|
||||
*/
|
||||
public static function singularLabel(): string
|
||||
{
|
||||
return __('$MODEL_NAME_SINGULAR$');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the fields displayed by the resource.
|
||||
*
|
||||
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
|
||||
* @return array<int, \Laravel\Nova\Fields\FieldElement|\Laravel\Nova\Panel>
|
||||
*/
|
||||
public function fields(NovaRequest $request): array
|
||||
{
|
||||
return [
|
||||
ID::make('id')->sortable(),
|
||||
];
|
||||
}
|
||||
}
|
||||
33
app/Console/Commands/stubs/make-module/repository.stub
Normal file
33
app/Console/Commands/stubs/make-module/repository.stub
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace $NAMESPACE$;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Http\Request;
|
||||
use $MODEL_NAMESPACE$;
|
||||
|
||||
class $MODULE_NAME$Repository
|
||||
{
|
||||
/**
|
||||
* $queryBuilder
|
||||
*
|
||||
* @var \Illuminate\Database\Eloquent\Builder<\$MODEL_NAMESPACE$>
|
||||
*/
|
||||
protected Builder $queryBuilder;
|
||||
|
||||
/**
|
||||
* Model
|
||||
*/
|
||||
public static function model(): string
|
||||
{
|
||||
return $MODULE_NAME$::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* Product repository
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->queryBuilder = self::model()::query();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user