PHP code example of erikaraujo / laravel-stubs

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);
}
json
"scripts": {
    "post-update-cmd": [
        "@php artisan erikaraujo-stub:publish --force"
    ]
}
bash
php artisan erikaraujo-stub:publish
bash
php artisan erikaraujo-stub:publish --softdeletes
bash
php artisan erikaraujo-stub:publish --softdeletes
bash
php artisan erikaraujo-stub:publish --inertia
bash
php artisan erikaraujo-stub:publish --json
bash
php artisan erikaraujo-stub:publish --inertia --softdeletes
bash
php artisan erikaraujo-stub:publish --json --softdeletes
bash
php artisan erikaraujo-stub:publish --json --inertia --softdeletes
bash
php artisan erikaraujo-stub:publish --json --inertia --softdeletes --force