•    What Empathy Is Not 

    Communication can not work without empathy and that’s why empathy is hopefully the most important factor in your company’s culture. Every once in awhile, someone does a talk or writes a post about why empathy is important and why it should be your number one skill. These are very informative, but most of them are missing one key factor: what doesn’t constitute as empathy. Let’s jump right in.

    Empathy is not sympathy. Sympathy is feeling pity and sorrow for someone. Pity is conjured up when you witness someone’s misfortune and have an uncomfortable, negative reaction to their circumstance. Pity can sometimes be sorrow, but it is often based in shame. You feel ashamed for the person that got reprimanded by their boss in front of the entire team. You want to grant mercy to the person clearly bombing their presentation to the client.

    Do you see how these things aren’t empathy? Often, to have true empathy, you must set aside your feelings about the situation in order to net the best result. Pity, sorrow, and shame are useless emotions; they lead to embarrassment and that often leads to isolation which is at odds with empathy. When you are truly empathetic, you may feel those emotions, but you don’t let them take control of the situation.

    Empathy isn’t liking everyone. Another common misconception is that you must have positive feelings about a person to truly empathize with them. This is false. Though it is extremely difficult to feel any empathy whatsoever for people you disagree with, liking a person is not a prerequisite to feeling empathy. In fact, empathy is most powerful when shown for people you don’t generally get along with. Why? Because empathy is hearing everyone out, especially when you dislike them.

    A very poignant example is when you disagree with someone politically. The empathetic thing for both parties to do is to hear the other side calmly and articulately explain their views. When both sides listen intently and keep emotions out of it (which is incredibly difficult), they can have a productive and informative discussion. Unfortunately, we allow our personal feelings get in the way of having a fruitful dialogue. Imagine a world where we all could just talk to each other without fear or judgment. What does that world look like? This is why empathy is so important. Now, take that concept and use it at the office.

    Empathy does not equal hugs. There’s nothing wrong with hugs; hugs are great. Hugging people, however, has very little to do with empathy. What are the benefits of hugging? There are plenty. Hugging increases serotonin in your brain, making you happier. Hugging also releases a hormone called oxytocin which promotes attachment in relationships. Hugging may also keep you from getting sick; since hugging benefits relationships of all sorts, it also helps people feel they have social support. More support means less stress, and less stress means you are less likely to get sick. Although all of these are great, nowhere in the research does it say hugging is empathetic.

    Here’s the caveat of hugging and empathy: they are both a byproduct of compassion. Being an empathetic friend means occasionally giving a hug when one is needed. That’s not because you just want to give your friend a hug. It is because you have internalized their struggle or joy, and you know they need an embrace to feel connected in the moment. When you are dealing with a coworker having a bad day, however, hugging isn’t as appropriate. Maybe they just need your ear for a few minutes or would benefit from being taken out to lunch.

    Here is the bottom line: in all of these situations mentioned above, empathy is consistently the verb. Byproducts of empathy may be changing your mind about someone or feeling compassion towards a person you previously disliked. It may also be learning to put pity or shame aside to forge ahead when you’ve reached an impasse. To foster empathy in your life, you must first tackle anti-empathetic actions. Once you do that, you’ll have a much easier time showing empathy to everyone that crosses your path.

  •    Angular 4.0 Is Now Released 

    Angular 4.0 is now released and is not only smaller & faster, but also has an improved *ngIf and *ngFor, source maps for templates, and more.

    *ngIf and *ngFor

    The template binding syntax now supports a couple helpful changes. You can now use an if/else style syntax, and assign local variables such as when unrolling an observable:

    <div *ngIf="userList | async as users; else loading">
      <user-profile *ngFor="let user of users; count as count" [user]="user">
      </user-profile>
     <div>{{count}} total users</div>
    </div>
    <ng-template #loading>Loading...</ng-template>
    

    TypeScript 2.1 and 2.2 compatibility

    Angular is updated to a more recent version of TypeScript. This will improve the speed of ngc and you will get better type checking throughout your application.

    Source Maps for Templates

    Now when there is an error caused by something in one of your templates, it includes generated source maps that give a meaningful context in terms of the original template.

    For complete details on this release check out the Angular site and the announcement blog post.

    Update: For those wondering what happened to Angular 3 it was skipped over and you can see this talk from December when they announced this:

  •    PhpStorm Improves Support for Laravel Blade 

    PhpStorm just released version 2017.1 and it includes many improvements including support for Codeception, PhpUnit 6.0, and more PHP 7.x features.

    Beyond these, it also adds support for @includeWhen, @component and @slot directives and PHPDoc through Blade injections.

    Here is a screenshot showing the PhpDoc for Blade files:

    For the full details on this release check out their what’s new page that highlights all the new features.

  •    Laravel Package To Login As Other Users During Development 

    For websites with advanced ACL functionality, developers often find themselves manually logging in as a different user, then switching back to their own account. This can prove to be a tedious process, especially when trying to debug a problem.

    Digital agency VIA Creative aims to solve that problem with its latest package: Sudo Su.

    Sudo Su injects a small button into the corner of every page which, when clicked, reveals a list of users.

    Selecting a user from this list will automatically log you in as that user, while also preserving the original user ID in the session. This feature allows you to quickly switch back to the original account at the click of a button.

    Once you have logged in, the button will turn green to indicate it has been activated. By clicking again, you can immediately revert to your original user account.

    Here is an animated Gif showing this in action:

    The package can be installed in three easy steps:

    1. Pull the package in via Composer.

    composer require viacreative/sudo-su
    

    2. Register the service provider.

    class AppServiceProvider extends ServiceProvider
    {
        public function register()
        {
            if (env('APP_DEBUG')) {
                $this->app->register('VIACreative\SudoSu\ServiceProvider');
            }
        }
    }
    

    ⚠️ Warning: you should not register the provider globally like usual in the config/app.php file.

    3. Publish the package’s config file (the package won’t work without it).

    php artisan vendor:publish
    

    ⚠️ Warning!

    This package can pose a serious security issue if used incorrectly, as anyone will be able to take control of any user’s account. Please ensure the service provider is only registered when the app is in a debug/local environment.

    By default, the package will disable itself on any domains that don’t have a TLD of .dev or .local. This is a security measure to reduce the risk of accidentally enabling the package in production. If you have a different TLD in development, you can edit the config option sudosu.allowed_tlds.

    To keep up to date with VIA Creative, you can either follow them at @viacreative or visit their website.

  •    Using Variables in Your .env File 

    Laravel’s .env file is included to use, so it’s easy to have a different configuration based on the environment your app is running on. This gives you the flexibility to have different variables for local, staging, production, and even different developers’ machines.

    Typically these files are small and manageable, but there are times when you run into situations where you duplicate the same data within the file. Here is an example:

    MAIL_USERNAME=hello@laravel-news.com
    MAIL_FROM_ADDRESS=hello@laravel-news.com
    

    The dotenv package that Laravel relies on can use variables with other defined variables in this same file. For example:

    MAIL_USERNAME=hello@laravel-news.com
    MAIL_FROM_ADDRESS=${MAIL_USERNAME}
    

    Granted this file isn’t usually crazy long or complicated, but this simple trick allows you not to repeat yourself and can be useful when you have multiple services requiring the same piece of data.

    Many thanks to Caleb Porzio for pointing out the ability to do this.

 最新レシピ

   scrutinizerCIを使って継続的インテグレーションと静的解析

  Solution / 2014年11月29日 23:46

   データベースをクエリービルダー、Eloquentを使用せずに操作したい

  DB / 2014年11月03日 16:31

   ページネーションを実装する

  Paginator / 2014年09月27日 22:09

   クエリー結果でページネーションを実装する

  DB / 2014年09月27日 22:09

   クエリー結果をキャッシュする

  DB / 2014年09月27日 22:09

   Bladeで @while を使用する

  Blade / 2014年09月27日 22:09

   データベースの接続先を変更する

  DB / 2014年09月10日 10:56

   ファサードクラス一覧

  Core Extension / 2014年09月10日 10:56

   Laravelプロジェクトでphpunitを利用する

  Testing / 2014年09月09日 00:49

   ファサードをモックする

  Testing / 2014年09月09日 00:49

   シンプルなサービスプロバイダーを作成する

  Service Provider / 2014年09月09日 00:49

   LaravelプロジェクトでTravis CIを使った継続的インテグレーション

  Solution / 2014年09月09日 00:49

   クロージャを利用したルーティングの作成

  Route / 2014年09月09日 00:49

   ミドルウェアについて理解する

  Middleware / 2014年09月09日 00:49

   簡単でシンプルなミドルウェアクラスを作成する

  Middleware / 2014年09月09日 00:49

   デフォルトの実行言語を設定

  Lang / 2014年09月09日 00:49

   翻訳を確認

  Lang / 2014年09月09日 00:49

   キーに対応する多言語翻訳文字列を取得する

  Lang / 2014年09月09日 00:49

   デフォルトで利用されている言語環境を取得する

  Lang / 2014年09月09日 00:49

   ロケール(言語)変更を検知する

  Lang / 2014年09月09日 00:49

   メッセージローダーにnamespaceを追加する

  Lang / 2014年09月09日 00:49

   XCacheをインストールする

  Installation / 2014年09月09日 00:49

   VirtualBoxをインストールする

  Installation / 2014年09月09日 00:49

   Vagrantをインストールする

  Installation / 2014年09月09日 00:49

   SQLiteをインストールする

  Installation / 2014年09月09日 00:49
このレシピサイトについて

このサイトはLaravel Recipesのレシピを日本語訳にしたものと、
日本独自のレシピを含んでします。
レシピの要望等がありましたら、お気軽にご連絡ください。
またこのサイトはオープンソースで公開されています。
Laravelの学習等にお役立てください
Laravel.JpRecipe

View all Packages for your Laravel projects