wip
This commit is contained in:
19
stubs/cast.inbound.stub
Normal file
19
stubs/cast.inbound.stub
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Contracts\Database\Eloquent\CastsInboundAttributes;
|
||||
|
||||
class {{ class }} implements CastsInboundAttributes
|
||||
{
|
||||
/**
|
||||
* Prepare the given value for storage.
|
||||
*
|
||||
* @param array<string, mixed> $attributes
|
||||
*/
|
||||
public function set(Model $model, string $key, mixed $value, array $attributes): mixed
|
||||
{
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
29
stubs/cast.stub
Normal file
29
stubs/cast.stub
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
|
||||
|
||||
class {{ class }} implements CastsAttributes
|
||||
{
|
||||
/**
|
||||
* Cast the given value.
|
||||
*
|
||||
* @param array<string, mixed> $attributes
|
||||
*/
|
||||
public function get(Model $model, string $key, mixed $value, array $attributes): mixed
|
||||
{
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare the given value for storage.
|
||||
*
|
||||
* @param array<string, mixed> $attributes
|
||||
*/
|
||||
public function set(Model $model, string $key, mixed $value, array $attributes): mixed
|
||||
{
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
30
stubs/console.stub
Normal file
30
stubs/console.stub
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class {{ class }} extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = '{{ command }}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Command description';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
49
stubs/controller.api.stub
Normal file
49
stubs/controller.api.stub
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use {{ rootNamespace }}Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class {{ class }} extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(string $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, string $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(string $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
17
stubs/controller.invokable.stub
Normal file
17
stubs/controller.invokable.stub
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use {{ rootNamespace }}Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class {{ class }} extends Controller
|
||||
{
|
||||
/**
|
||||
* Handle the incoming request.
|
||||
*/
|
||||
public function __invoke(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
50
stubs/controller.model.api.stub
Normal file
50
stubs/controller.model.api.stub
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use {{ namespacedModel }};
|
||||
use {{ rootNamespace }}Http\Controllers\Controller;
|
||||
use {{ namespacedRequests }}
|
||||
|
||||
class {{ class }} extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store({{ storeRequest }} $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show({{ model }} ${{ modelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update({{ updateRequest }} $request, {{ model }} ${{ modelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy({{ model }} ${{ modelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
66
stubs/controller.model.stub
Normal file
66
stubs/controller.model.stub
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use {{ namespacedModel }};
|
||||
use {{ rootNamespace }}Http\Controllers\Controller;
|
||||
use {{ namespacedRequests }}
|
||||
|
||||
class {{ class }} extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store({{ storeRequest }} $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show({{ model }} ${{ modelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit({{ model }} ${{ modelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update({{ updateRequest }} $request, {{ model }} ${{ modelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy({{ model }} ${{ modelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
51
stubs/controller.nested.api.stub
Normal file
51
stubs/controller.nested.api.stub
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use {{ namespacedModel }};
|
||||
use {{ rootNamespace }}Http\Controllers\Controller;
|
||||
use {{ namespacedParentModel }};
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class {{ class }} extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index({{ parentModel }} ${{ parentModelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request, {{ parentModel }} ${{ parentModelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show({{ parentModel }} ${{ parentModelVariable }}, {{ model }} ${{ modelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, {{ parentModel }} ${{ parentModelVariable }}, {{ model }} ${{ modelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy({{ parentModel }} ${{ parentModelVariable }}, {{ model }} ${{ modelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
43
stubs/controller.nested.singleton.api.stub
Normal file
43
stubs/controller.nested.singleton.api.stub
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use {{ namespacedModel }};
|
||||
use {{ rootNamespace }}Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use {{ namespacedParentModel }};
|
||||
|
||||
class {{ class }} extends Controller
|
||||
{
|
||||
/**
|
||||
* Store the newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request, {{ parentModel }} ${{ parentModelVariable }}): never
|
||||
{
|
||||
abort(404);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the resource.
|
||||
*/
|
||||
public function show({{ parentModel }} ${{ parentModelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the resource in storage.
|
||||
*/
|
||||
public function update(Request $request, {{ parentModel }} ${{ parentModelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the resource from storage.
|
||||
*/
|
||||
public function destroy({{ parentModel }} ${{ parentModelVariable }}): never
|
||||
{
|
||||
abort(404);
|
||||
}
|
||||
}
|
||||
59
stubs/controller.nested.singleton.stub
Normal file
59
stubs/controller.nested.singleton.stub
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use {{ namespacedModel }};
|
||||
use {{ rootNamespace }}Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use {{ namespacedParentModel }};
|
||||
|
||||
class {{ class }} extends Controller
|
||||
{
|
||||
/**
|
||||
* Show the form for creating the new resource.
|
||||
*/
|
||||
public function create({{ parentModel }} ${{ parentModelVariable }}): never
|
||||
{
|
||||
abort(404);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store the newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request, {{ parentModel }} ${{ parentModelVariable }}): never
|
||||
{
|
||||
abort(404);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the resource.
|
||||
*/
|
||||
public function show({{ parentModel }} ${{ parentModelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the resource.
|
||||
*/
|
||||
public function edit({{ parentModel }} ${{ parentModelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the resource in storage.
|
||||
*/
|
||||
public function update(Request $request, {{ parentModel }} ${{ parentModelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the resource from storage.
|
||||
*/
|
||||
public function destroy({{ parentModel }} ${{ parentModelVariable }}): never
|
||||
{
|
||||
abort(404);
|
||||
}
|
||||
}
|
||||
67
stubs/controller.nested.stub
Normal file
67
stubs/controller.nested.stub
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use {{ namespacedModel }};
|
||||
use {{ rootNamespace }}Http\Controllers\Controller;
|
||||
use {{ namespacedParentModel }};
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class {{ class }} extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index({{ parentModel }} ${{ parentModelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create({{ parentModel }} ${{ parentModelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request, {{ parentModel }} ${{ parentModelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show({{ parentModel }} ${{ parentModelVariable }}, {{ model }} ${{ modelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit({{ parentModel }} ${{ parentModelVariable }}, {{ model }} ${{ modelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, {{ parentModel }} ${{ parentModelVariable }}, {{ model }} ${{ modelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy({{ parentModel }} ${{ parentModelVariable }}, {{ model }} ${{ modelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
11
stubs/controller.plain.stub
Normal file
11
stubs/controller.plain.stub
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use {{ rootNamespace }}Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class {{ class }} extends Controller
|
||||
{
|
||||
//
|
||||
}
|
||||
41
stubs/controller.singleton.api.stub
Normal file
41
stubs/controller.singleton.api.stub
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use {{ rootNamespace }}Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class {{ class }} extends Controller
|
||||
{
|
||||
/**
|
||||
* Store the newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request): never
|
||||
{
|
||||
abort(404);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the resource.
|
||||
*/
|
||||
public function show()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the resource in storage.
|
||||
*/
|
||||
public function update(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the resource from storage.
|
||||
*/
|
||||
public function destroy(): never
|
||||
{
|
||||
abort(404);
|
||||
}
|
||||
}
|
||||
57
stubs/controller.singleton.stub
Normal file
57
stubs/controller.singleton.stub
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use {{ rootNamespace }}Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class {{ class }} extends Controller
|
||||
{
|
||||
/**
|
||||
* Show the form for creating the resource.
|
||||
*/
|
||||
public function create(): never
|
||||
{
|
||||
abort(404);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store the newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request): never
|
||||
{
|
||||
abort(404);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the resource.
|
||||
*/
|
||||
public function show()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the resource.
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the resource in storage.
|
||||
*/
|
||||
public function update(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the resource from storage.
|
||||
*/
|
||||
public function destroy(): never
|
||||
{
|
||||
abort(404);
|
||||
}
|
||||
}
|
||||
65
stubs/controller.stub
Normal file
65
stubs/controller.stub
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use {{ rootNamespace }}Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class {{ class }} extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(string $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit(string $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, string $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(string $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
36
stubs/event.stub
Normal file
36
stubs/event.stub
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Illuminate\Broadcasting\Channel;
|
||||
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||
use Illuminate\Broadcasting\PresenceChannel;
|
||||
use Illuminate\Broadcasting\PrivateChannel;
|
||||
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class {{ class }}
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the channels the event should broadcast on.
|
||||
*
|
||||
* @return array<int, \Illuminate\Broadcasting\Channel>
|
||||
*/
|
||||
public function broadcastOn(): array
|
||||
{
|
||||
return [
|
||||
new PrivateChannel('channel-name'),
|
||||
];
|
||||
}
|
||||
}
|
||||
23
stubs/factory.stub
Normal file
23
stubs/factory.stub
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace {{ factoryNamespace }};
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\{{ namespacedModel }}>
|
||||
*/
|
||||
class {{ factory }}Factory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
||||
31
stubs/job.queued.stub
Normal file
31
stubs/job.queued.stub
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldBeUnique;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class {{ class }} implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
26
stubs/job.stub
Normal file
26
stubs/job.stub
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
|
||||
class {{ class }}
|
||||
{
|
||||
use Dispatchable;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
53
stubs/mail.stub
Normal file
53
stubs/mail.stub
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Mail\Mailables\Content;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class {{ class }} extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message envelope.
|
||||
*/
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
return new Envelope(
|
||||
subject: '{{ subject }}',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message content definition.
|
||||
*/
|
||||
public function content(): Content
|
||||
{
|
||||
return new Content(
|
||||
view: 'view.name',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the attachments for the message.
|
||||
*
|
||||
* @return array<int, \Illuminate\Mail\Mailables\Attachment>
|
||||
*/
|
||||
public function attachments(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
53
stubs/markdown-mail.stub
Normal file
53
stubs/markdown-mail.stub
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Mail\Mailables\Content;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class {{ class }} extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message envelope.
|
||||
*/
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
return new Envelope(
|
||||
subject: '{{ subject }}',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message content definition.
|
||||
*/
|
||||
public function content(): Content
|
||||
{
|
||||
return new Content(
|
||||
markdown: '{{ view }}',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the attachments for the message.
|
||||
*
|
||||
* @return array<int, \Illuminate\Mail\Mailables\Attachment>
|
||||
*/
|
||||
public function attachments(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
51
stubs/markdown-notification.stub
Normal file
51
stubs/markdown-notification.stub
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
|
||||
class {{ class }} extends Notification
|
||||
{
|
||||
use Queueable;
|
||||
|
||||
/**
|
||||
* Create a new notification instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the notification's delivery channels.
|
||||
*
|
||||
* @return array<int, string>
|
||||
*/
|
||||
public function via(object $notifiable): array
|
||||
{
|
||||
return ['mail'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the mail representation of the notification.
|
||||
*/
|
||||
public function toMail(object $notifiable): MailMessage
|
||||
{
|
||||
return (new MailMessage)->markdown('{{ view }}');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the array representation of the notification.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function toArray(object $notifiable): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
||||
20
stubs/middleware.stub
Normal file
20
stubs/middleware.stub
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class {{ class }}
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
|
||||
*/
|
||||
public function handle(Request $request, Closure $next): Response
|
||||
{
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
27
stubs/migration.create.stub
Normal file
27
stubs/migration.create.stub
Normal 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 }}');
|
||||
}
|
||||
};
|
||||
24
stubs/migration.stub
Normal file
24
stubs/migration.stub
Normal file
@@ -0,0 +1,24 @@
|
||||
<?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
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
};
|
||||
28
stubs/migration.update.stub
Normal file
28
stubs/migration.update.stub
Normal file
@@ -0,0 +1,28 @@
|
||||
<?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::table('{{ table }}', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('{{ table }}', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
};
|
||||
10
stubs/model.pivot.stub
Normal file
10
stubs/model.pivot.stub
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Illuminate\Database\Eloquent\Relations\Pivot;
|
||||
|
||||
class {{ class }} extends Pivot
|
||||
{
|
||||
//
|
||||
}
|
||||
11
stubs/model.stub
Normal file
11
stubs/model.stub
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class {{ class }} extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
}
|
||||
54
stubs/notification.stub
Normal file
54
stubs/notification.stub
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
|
||||
class {{ class }} extends Notification
|
||||
{
|
||||
use Queueable;
|
||||
|
||||
/**
|
||||
* Create a new notification instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the notification's delivery channels.
|
||||
*
|
||||
* @return array<int, string>
|
||||
*/
|
||||
public function via(object $notifiable): array
|
||||
{
|
||||
return ['mail'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the mail representation of the notification.
|
||||
*/
|
||||
public function toMail(object $notifiable): MailMessage
|
||||
{
|
||||
return (new MailMessage)
|
||||
->line('The introduction to the notification.')
|
||||
->action('Notification Action', url('/'))
|
||||
->line('Thank you for using our application!');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the array representation of the notification.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function toArray(object $notifiable): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
||||
8
stubs/observer.plain.stub
Normal file
8
stubs/observer.plain.stub
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
class {{ class }}
|
||||
{
|
||||
//
|
||||
}
|
||||
48
stubs/observer.stub
Normal file
48
stubs/observer.stub
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use {{ namespacedModel }};
|
||||
|
||||
class {{ class }}
|
||||
{
|
||||
/**
|
||||
* Handle the {{ model }} "created" event.
|
||||
*/
|
||||
public function created({{ model }} ${{ modelVariable }}): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the {{ model }} "updated" event.
|
||||
*/
|
||||
public function updated({{ model }} ${{ modelVariable }}): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the {{ model }} "deleted" event.
|
||||
*/
|
||||
public function deleted({{ model }} ${{ modelVariable }}): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the {{ model }} "restored" event.
|
||||
*/
|
||||
public function restored({{ model }} ${{ modelVariable }}): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the {{ model }} "force deleted" event.
|
||||
*/
|
||||
public function forceDeleted({{ model }} ${{ modelVariable }}): void
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
16
stubs/policy.plain.stub
Normal file
16
stubs/policy.plain.stub
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use {{ namespacedUserModel }};
|
||||
|
||||
class {{ class }}
|
||||
{
|
||||
/**
|
||||
* Create a new policy instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
81
stubs/policy.stub
Normal file
81
stubs/policy.stub
Normal file
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Illuminate\Auth\Access\Response;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
use {{ namespacedModel }};
|
||||
use {{ namespacedUserModel }};
|
||||
|
||||
class {{ class }}
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
/**
|
||||
* Perform pre-authorization checks.
|
||||
*/
|
||||
public function before({{ user }} $user, string $ability): Response|null
|
||||
{
|
||||
if ($user->isMe()) {
|
||||
return $this->allow();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can view any models.
|
||||
*/
|
||||
public function viewAny({{ user }} $user): Response
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can view the model.
|
||||
*/
|
||||
public function view({{ user }} $user, {{ model }} ${{ modelVariable }}): Response
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can create models.
|
||||
*/
|
||||
public function create({{ user }} $user): Response
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can update the model.
|
||||
*/
|
||||
public function update({{ user }} $user, {{ model }} ${{ modelVariable }}): Response
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can delete the model.
|
||||
*/
|
||||
public function delete({{ user }} $user, {{ model }} ${{ modelVariable }}): Response
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can restore the model.
|
||||
*/
|
||||
public function restore({{ user }} $user, {{ model }} ${{ modelVariable }}): Response
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can permanently delete the model.
|
||||
*/
|
||||
public function forceDelete({{ user }} $user, {{ model }} ${{ modelVariable }}): Response
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
24
stubs/provider.stub
Normal file
24
stubs/provider.stub
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class {{ class }} extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register services.
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
28
stubs/request.stub
Normal file
28
stubs/request.stub
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class {{ class }} extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
||||
19
stubs/resource-collection.stub
Normal file
19
stubs/resource-collection.stub
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\ResourceCollection;
|
||||
|
||||
class {{ class }} extends ResourceCollection
|
||||
{
|
||||
/**
|
||||
* Transform the resource collection into an array.
|
||||
*
|
||||
* @return array<int|string, mixed>
|
||||
*/
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return parent::toArray($request);
|
||||
}
|
||||
}
|
||||
19
stubs/resource.stub
Normal file
19
stubs/resource.stub
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class {{ class }} extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return parent::toArray($request);
|
||||
}
|
||||
}
|
||||
19
stubs/rule.stub
Normal file
19
stubs/rule.stub
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
|
||||
class {{ class }} implements ValidationRule
|
||||
{
|
||||
/**
|
||||
* Run the validation rule.
|
||||
*
|
||||
* @param \Closure(string): \Illuminate\Translation\PotentiallyTranslatedString $fail
|
||||
*/
|
||||
public function validate(string $attribute, mixed $value, Closure $fail): void
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
18
stubs/scope.stub
Normal file
18
stubs/scope.stub
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Scope;
|
||||
|
||||
class {{ class }} implements Scope
|
||||
{
|
||||
/**
|
||||
* Apply the scope to a given Eloquent query builder.
|
||||
*/
|
||||
public function apply(Builder $builder, Model $model): void
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
17
stubs/seeder.stub
Normal file
17
stubs/seeder.stub
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class {{ class }} extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
20
stubs/test.stub
Normal file
20
stubs/test.stub
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Tests\TestCase;
|
||||
|
||||
class {{ class }} extends TestCase
|
||||
{
|
||||
/**
|
||||
* A basic feature test example.
|
||||
*/
|
||||
public function test_example(): void
|
||||
{
|
||||
$response = $this->get('/');
|
||||
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
}
|
||||
16
stubs/test.unit.stub
Normal file
16
stubs/test.unit.stub
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class {{ class }} extends TestCase
|
||||
{
|
||||
/**
|
||||
* A basic unit test example.
|
||||
*/
|
||||
public function test_example(): void
|
||||
{
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
}
|
||||
26
stubs/view-component.stub
Normal file
26
stubs/view-component.stub
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Closure;
|
||||
use Illuminate\View\Component;
|
||||
use Illuminate\Contracts\View\View;
|
||||
|
||||
class {{ class }} extends Component
|
||||
{
|
||||
/**
|
||||
* Create a new component instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*/
|
||||
public function render(): View|Closure|string
|
||||
{
|
||||
return {{ view }};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user