PHP code example of ibrhaim13 / mongodb-translate

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

    

ibrhaim13 / mongodb-translate example snippets

bash
php artisan vendor:publish --force --tag=translate13
bash
php artisan migrate
bash
# app/Http/Kernel.php

protected $middlewareGroups = [
        'web' => [
        ...,
        Ibrhaim13\Translate\Http\Middleware\Web\Localization::class,
        ...
        ]
bash
# app/Providers/RouteServiceProvider.php
# boot function inside route callback funcation add ->prefix(Localization::routePrefix())
      Route::middleware('web')->prefix(Localization::routePrefix())
           ->group(base_path('routes/web.php'));
bash
# app/Models/YourTranslateModelExtendFromPackageModel.php
    public static array $groups = [
        'str_public',
        'str_admin',
        //here add your new group as you like
    ];
str_admin