1. Go to this page and download the library: Download erikaraujo/laravel-stubs library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
erikaraujo / laravel-stubs example snippets
public function index()
{
return Inertia::render('{{ model }}/Index', [
'{{ modelVariable }}' => {{ model }}::paginate()->onEachSide(1),
]);
}
public function index()
{
${{ modelVariable }} = {{ model }}::all();
return response()->json([
'data' => ${{ modelVariable }},
'total' => ${{ modelVariable }}->count(),
], 200);
}