PHP code example of laragod / toolkit

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

    

laragod / toolkit example snippets


  return [
      'locales' => [
          'en' => 'English',
          'pl' => 'Polski',   // add as many as you need
      ],
      'default'  => env('APP_LOCALE', 'en'),
      'fallback' => env('APP_FALLBACK_LOCALE', 'en'),
      'cookie_name'     => 'locale',
      'cookie_lifetime' => 43200, // 30 days in minutes
  ];

  use Laragod\Toolkit\Services\NotificationManager;

  class ContactController extends Controller
  {
      public function __construct(
          private readonly NotificationManager $notifications,
      ) {}

      public function store(Request $request): JsonResponse
      {
          $data = $request->validate([
              'name'    => '           ? response()->json(['ok' => true])
              : response()->json(['ok' => false, 'message' => 'Failed to send'], 500);
      }
  }