PHP code example of danydevco / rocket

1. Go to this page and download the library: Download danydevco/rocket 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/ */

    

danydevco / rocket example snippets


/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "api" middleware group. Make something great!
|
*/

Route::group(['middleware' => 'accept-json'], function () {
    // Aca van las rutas de la API
});

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "api" middleware group. Make something great!
|
*/

Route::group(['middleware' => 'accept-json'], function () {

    Route::group(['middleware' => ['auth:sanctum', 'rocket.refresh.token']], function () {
        // Aca van las rutas de la API que se desean proteger
    });
});


## Opcionales

### Herramientas de Desarrollo
Para facilitar el desarrollo y depuración de tu aplicación, puedes optar por instalar las siguientes herramientas:
- **barryvdh/laravel-debugbar:** Esta herramienta te proporciona una barra de depuración en la parte inferior de tu aplicación cuando estás en el entorno de desarrollo. Para instalarla, ejecuta el siguiente comando:

$user = User::find(1);
echo $user->name; // Imprime "Nombre Apellido"
 bash
 php artisan vendor:publish --tag=rocket-config
 php artisan migrate
 php artisan rocket:seeder