- Complete GGZ Ecademy Laravel backend application - RESTful API for learning products, members, filters - Authentication and authorization system - Database migrations and seeders - Custom CRUD generator commands - Email notification system - Integration with frontend applications
This commit is contained in:
64
stubs/controller.api.stub
Normal file
64
stubs/controller.api.stub
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use {{ rootNamespace }}Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class {{ class }} extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
20
stubs/controller.invokable.stub
Normal file
20
stubs/controller.invokable.stub
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use DummyRootNamespaceHttp\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class {{ class }} extends Controller
|
||||
{
|
||||
/**
|
||||
* Handle the incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function __invoke(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
65
stubs/controller.model.api.stub
Normal file
65
stubs/controller.model.api.stub
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use {{ namespacedModel }};
|
||||
use {{ rootNamespace }}Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class {{ class }} extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \{{ namespacedModel }} ${{ modelVariable }}
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show({{ model }} ${{ modelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \{{ namespacedModel }} ${{ modelVariable }}
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, {{ model }} ${{ modelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \{{ namespacedModel }} ${{ modelVariable }}
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy({{ model }} ${{ modelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
86
stubs/controller.model.stub
Normal file
86
stubs/controller.model.stub
Normal file
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use {{ namespacedModel }};
|
||||
use {{ rootNamespace }}Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class {{ class }} extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \{{ namespacedModel }} ${{ modelVariable }}
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show({{ model }} ${{ modelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \{{ namespacedModel }} ${{ modelVariable }}
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit({{ model }} ${{ modelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \{{ namespacedModel }} ${{ modelVariable }}
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, {{ model }} ${{ modelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \{{ namespacedModel }} ${{ modelVariable }}
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy({{ model }} ${{ modelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
71
stubs/controller.nested.api.stub
Normal file
71
stubs/controller.nested.api.stub
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use {{ namespacedModel }};
|
||||
use {{ rootNamespace }}Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use {{ namespacedParentModel }};
|
||||
|
||||
class {{ class }} extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @param \{{ namespacedParentModel }} ${{ parentModelVariable }}
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index({{ parentModel }} ${{ parentModelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \{{ namespacedParentModel }} ${{ parentModelVariable }}
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request, {{ parentModel }} ${{ parentModelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \{{ namespacedParentModel }} ${{ parentModelVariable }}
|
||||
* @param \{{ namespacedModel }} ${{ modelVariable }}
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show({{ parentModel }} ${{ parentModelVariable }}, {{ model }} ${{ modelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \{{ namespacedParentModel }} ${{ parentModelVariable }}
|
||||
* @param \{{ namespacedModel }} ${{ modelVariable }}
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, {{ parentModel }} ${{ parentModelVariable }}, {{ model }} ${{ modelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \{{ namespacedParentModel }} ${{ parentModelVariable }}
|
||||
* @param \{{ namespacedModel }} ${{ modelVariable }}
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy({{ parentModel }} ${{ parentModelVariable }}, {{ model }} ${{ modelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
94
stubs/controller.nested.stub
Normal file
94
stubs/controller.nested.stub
Normal file
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use {{ namespacedModel }};
|
||||
use {{ rootNamespace }}Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use {{ namespacedParentModel }};
|
||||
|
||||
class {{ class }} extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @param \{{ namespacedParentModel }} ${{ parentModelVariable }}
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index({{ parentModel }} ${{ parentModelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @param \{{ namespacedParentModel }} ${{ parentModelVariable }}
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create({{ parentModel }} ${{ parentModelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \{{ namespacedParentModel }} ${{ parentModelVariable }}
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request, {{ parentModel }} ${{ parentModelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \{{ namespacedParentModel }} ${{ parentModelVariable }}
|
||||
* @param \{{ namespacedModel }} ${{ modelVariable }}
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show({{ parentModel }} ${{ parentModelVariable }}, {{ model }} ${{ modelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \{{ namespacedParentModel }} ${{ parentModelVariable }}
|
||||
* @param \{{ namespacedModel }} ${{ modelVariable }}
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit({{ parentModel }} ${{ parentModelVariable }}, {{ model }} ${{ modelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \{{ namespacedParentModel }} ${{ parentModelVariable }}
|
||||
* @param \{{ namespacedModel }} ${{ modelVariable }}
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, {{ parentModel }} ${{ parentModelVariable }}, {{ model }} ${{ modelVariable }})
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \{{ namespacedParentModel }} ${{ parentModelVariable }}
|
||||
* @param \{{ namespacedModel }} ${{ modelVariable }}
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
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
|
||||
{
|
||||
//
|
||||
}
|
||||
85
stubs/controller.stub
Normal file
85
stubs/controller.stub
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use {{ rootNamespace }}Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class {{ class }} extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
44
stubs/custom/Controller.stub
Normal file
44
stubs/custom/Controller.stub
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\{{modelName}}Request;
|
||||
use App\Services\{{modelName}}Service;
|
||||
|
||||
class {{modelName}}Controller extends Controller
|
||||
{
|
||||
|
||||
private ${{modelNameSingularLowerCase}}Service;
|
||||
|
||||
public function __construct({{modelName}}Service ${{modelNameSingularLowerCase}}Service)
|
||||
{
|
||||
$this->{{modelNameSingularLowerCase}}Service = ${{modelNameSingularLowerCase}}Service;
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
${{modelNamePluralLowerCase}} = $this->{{modelNameSingularLowerCase}}Service->getAll();
|
||||
|
||||
return response()->json(${{modelNamePluralLowerCase}}, 201);
|
||||
}
|
||||
|
||||
public function store({{modelName}}Request $request)
|
||||
{
|
||||
${{modelNameSingularLowerCase}} = $this->{{modelNameSingularLowerCase}}Service->save($request->all());
|
||||
|
||||
return response()->json(${{modelNameSingularLowerCase}}, 201);
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
${{modelNameSingularLowerCase}} = $this->{{modelNameSingularLowerCase}}Service->get($id);
|
||||
|
||||
return response()->json(${{modelNameSingularLowerCase}});
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->{{modelNameSingularLowerCase}}Service->delete($id);
|
||||
return response()->json(null, 204);
|
||||
}
|
||||
}
|
||||
16
stubs/custom/Model.stub
Normal file
16
stubs/custom/Model.stub
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories;
|
||||
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class {{modelName}} extends Model
|
||||
{
|
||||
|
||||
use SoftDeletes;
|
||||
|
||||
protected $dates = ['deleted_at'];
|
||||
|
||||
protected $guarded = ['id'];
|
||||
}
|
||||
18
stubs/custom/Request.stub
Normal file
18
stubs/custom/Request.stub
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class {{modelName}}Request extends FormRequest
|
||||
{
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
53
stubs/custom/Service.stub
Normal file
53
stubs/custom/Service.stub
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Repositories\{{modelName}};
|
||||
|
||||
class {{modelName}}Service
|
||||
{
|
||||
private ${{modelNameSingularLowerCase}}Repository;
|
||||
|
||||
public function __construct({{modelName}} ${{modelNameSingularLowerCase}}Repository)
|
||||
{
|
||||
$this->{{modelNameSingularLowerCase}}Repository = ${{modelNameSingularLowerCase}}Repository;
|
||||
}
|
||||
|
||||
public function save(array $data)
|
||||
{
|
||||
if (isset($data['id'])) {
|
||||
${{modelNameSingularLowerCase}} = $this->{{modelNameSingularLowerCase}}Repository->findOrFail($data['id']);
|
||||
${{modelNameSingularLowerCase}}->update($data);
|
||||
} else {
|
||||
${{modelNameSingularLowerCase}} = $this->{{modelNameSingularLowerCase}}Repository->create($data);
|
||||
}
|
||||
|
||||
return ${{modelNameSingularLowerCase}};
|
||||
}
|
||||
|
||||
public function delete($id)
|
||||
{
|
||||
${{modelNameSingularLowerCase}} = $this->{{modelNameSingularLowerCase}}Repository->findOrFail($id);
|
||||
${{modelNameSingularLowerCase}}->delete();
|
||||
}
|
||||
|
||||
public function get($id)
|
||||
{
|
||||
return $this->{{modelNameSingularLowerCase}}Repository->findOrFail($id);
|
||||
}
|
||||
|
||||
public function getAll()
|
||||
{
|
||||
return $this->{{modelNameSingularLowerCase}}Repository->all();
|
||||
}
|
||||
|
||||
public function with(array $children)
|
||||
{
|
||||
return $this->{{modelNameSingularLowerCase}}Repository->with($children)->get();
|
||||
}
|
||||
|
||||
public function getOneWith($id, array $children)
|
||||
{
|
||||
return $this->{{modelNameSingularLowerCase}}Repository->with($children)->findOrFail($id);
|
||||
}
|
||||
}
|
||||
15
stubs/custom/Validator.stub
Normal file
15
stubs/custom/Validator.stub
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Validators;
|
||||
|
||||
class {{modelName}}Validator extends AbstractValidator
|
||||
{
|
||||
public function rules()
|
||||
{
|
||||
$this->rules = [
|
||||
|
||||
];
|
||||
|
||||
return $this->rules;
|
||||
}
|
||||
}
|
||||
34
stubs/job.queued.stub
Normal file
34
stubs/job.queued.stub
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
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.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
31
stubs/job.stub
Normal file
31
stubs/job.stub
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
|
||||
class {{ class }}
|
||||
{
|
||||
use Dispatchable, Queueable;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
31
stubs/migration.create.stub
Normal file
31
stubs/migration.create.stub
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class {{ class }} extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('{{ table }}', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('{{ table }}');
|
||||
}
|
||||
}
|
||||
28
stubs/migration.stub
Normal file
28
stubs/migration.stub
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class {{ class }} extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
32
stubs/migration.update.stub
Normal file
32
stubs/migration.update.stub
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class {{ class }} extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('{{ table }}', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
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
|
||||
{
|
||||
//
|
||||
}
|
||||
10
stubs/model.stub
Normal file
10
stubs/model.stub
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class {{ class }} extends Model
|
||||
{
|
||||
//
|
||||
}
|
||||
30
stubs/request.stub
Normal file
30
stubs/request.stub
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class {{ class }} extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
||||
22
stubs/test.stub
Normal file
22
stubs/test.stub
Normal file
@@ -0,0 +1,22 @@
|
||||
<?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.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testExample()
|
||||
{
|
||||
$response = $this->get('/');
|
||||
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
}
|
||||
18
stubs/test.unit.stub
Normal file
18
stubs/test.unit.stub
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class {{ class }} extends TestCase
|
||||
{
|
||||
/**
|
||||
* A basic unit test example.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testExample()
|
||||
{
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user