Skip to content

Instantly share code, notes, and snippets.

@ahmadshobirin
Last active September 23, 2025 14:25
Show Gist options
  • Select an option

  • Save ahmadshobirin/5e761c055b4bae2b13262ce9d58be2cb to your computer and use it in GitHub Desktop.

Select an option

Save ahmadshobirin/5e761c055b4bae2b13262ce9d58be2cb to your computer and use it in GitHub Desktop.

Revisions

  1. ahmadshobirin revised this gist Jan 2, 2023. 1 changed file with 12 additions and 0 deletions.
    12 changes: 12 additions & 0 deletions set locale and timezone indonesia in laravel.md
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,9 @@
    Change method boot

    ```
    use Carbon\Carbon;
    public function boot()
    {
    config(['app.locale' => 'id']);
    @@ -20,3 +23,12 @@ Change separated values
    'faker_locale' => 'id_ID',
    ```

    ### Display the date with Indonesian language
    Try this step in views or controller
    also step is recommended [here](https://gist.github.com/ahmadshobirin/5e761c055b4bae2b13262ce9d58be2cb?permalink_comment_id=3308262#gistcomment-3308262)

    ```
    Carbon\Carbon::parse('2019-03-01')->translatedFormat('d F Y');
    ```
  2. ahmadshobirin renamed this gist Mar 4, 2021. 1 changed file with 10 additions and 3 deletions.
    Original file line number Diff line number Diff line change
    @@ -1,15 +1,22 @@
    Open File -> App\Providers\AppServiceProvider
    And change method boot
    ## Open File App\Providers\AppServiceProvider
    Change method boot

    ```
    public function boot()
    {
    config(['app.locale' => 'id']);
    Carbon::setLocale('id');
    }
    ```

    Open File and changes -> config/app.php
    ### Open file config/app.php
    Change separated values

    ```
    'timezone' => 'Asia/Jakarta',
    'locale' => 'id',
    'faker_locale' => 'id_ID',
    ```

  3. ahmadshobirin revised this gist Nov 3, 2020. 1 changed file with 5 additions and 8 deletions.
    13 changes: 5 additions & 8 deletions set locale and timezone indonesia in laravel
    Original file line number Diff line number Diff line change
    @@ -1,18 +1,15 @@
    Open File -> App\Providers\AppServiceProvider
    And change method boot

    ```
    public function boot()
    {
    config(['app.locale' => 'id']);
    Carbon::setLocale('id');
    }
    ```

    Open File -> config/app.php
    Open File and changes -> config/app.php

    ```
    'timezone' => 'Asia/Jakarta',
    'locale' => 'id',
    'faker_locale' => 'id_ID',
    ```
    'timezone' => 'Asia/Jakarta',
    'locale' => 'id',
    'faker_locale' => 'id_ID',

  4. ahmadshobirin revised this gist Nov 3, 2020. 1 changed file with 9 additions and 7 deletions.
    16 changes: 9 additions & 7 deletions set locale and timezone indonesia in laravel
    Original file line number Diff line number Diff line change
    @@ -1,16 +1,18 @@
    // App\Providers\AppServiceProvider
    Open File -> App\Providers\AppServiceProvider

    ```
    public function boot()
    {
    config(['app.locale' => 'id']);
    Carbon::setLocale('id');
    date_default_timezone_set('Asia/Jakarta');

    }
    ```

    // config/app.php
    Open File -> config/app.php

    'timezone' => 'Asia/Jakarta',
    'locale' => 'id',
    'faker_locale' => 'id_ID',
    ```
    'timezone' => 'Asia/Jakarta',
    'locale' => 'id',
    'faker_locale' => 'id_ID',
    ```

  5. Ahmad Shobirin renamed this gist Jan 10, 2019. 1 changed file with 0 additions and 0 deletions.
  6. Ahmad Shobirin revised this gist Sep 4, 2018. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions laravel, php
    Original file line number Diff line number Diff line change
    @@ -4,12 +4,13 @@ public function boot()
    {
    config(['app.locale' => 'id']);
    Carbon::setLocale('id');
    // Resource::withoutWrapping();
    date_default_timezone_set('Asia/Jakarta');

    }

    // config/app.php

    'timezone' => 'Asia/Jakarta',
    'locale' => 'id',
    'faker_locale' => 'id_ID',
    'faker_locale' => 'id_ID',

  7. Ahmad Shobirin created this gist Sep 4, 2018.
    15 changes: 15 additions & 0 deletions laravel, php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    // App\Providers\AppServiceProvider

    public function boot()
    {
    config(['app.locale' => 'id']);
    Carbon::setLocale('id');
    // Resource::withoutWrapping();
    }

    // config/app.php

    'timezone' => 'Asia/Jakarta',
    'locale' => 'id',
    'faker_locale' => 'id_ID',