Skip to content

Instantly share code, notes, and snippets.

View ChVuagniaux's full-sized avatar

Christophe Vuagniaux ChVuagniaux

View GitHub Profile
@ChVuagniaux
ChVuagniaux / routes.php
Created May 1, 2018 13:39
RainLab - Generate indexed attribute for existring translations
<?php
/*
*
* Generate RainLab translation index
* @see https://github.com/rainlab/translate-plugin#indexed-attributes
*
*/
@ChVuagniaux
ChVuagniaux / routes.php
Last active November 7, 2022 11:05
Translate OctoberCMS RainLab.Location (https://octobercms.com/plugin/rainlab-location) Countries via https://RESTcountries.eu API
<?php
use RainLab\Location\Models\Country;
Route::get('generate-country-translations', function () {
$countries = Country::all();
$countries->each(function (Country $country) {
$response = file_get_contents("https://restcountries.com/v2/alpha/{$country->code}");
@ChVuagniaux
ChVuagniaux / Plugin.php
Last active March 6, 2025 19:46
Make October Import/Export feature compatible with Excel CSV (;) easily for your ends users
<?php namespace Your\Plugin;
use Event;
use System\Classes\PluginBase;
class Plugin extends PluginBase
{
// [...]
/**