技術情報

Useful Laravel Packages

Today I would like to share about useful laravel packages. The following packages are most useful 7 packages of the best laravel packages. Let’s take a look.

Laravel Debugbar

Laravel Debugbar is a package that help users add a developer toolbar to their applications. This package is mainly used for debugging purposes. There are a lot of options available in Debugbar. It allows you to monitor and debug all the requests directly on the Laravel view. You can also monitor SQL queries, Mail, and queue.  

https://github.com/barryvdh/laravel-debugbar

Laravel User Verification

This package allows you to handle user verification and validates emails. It generates and stores a verification token for the registered user, sends or queue an email with the verification token link, handles the token verification, sets the user as verified. This package also provides functionality, i.e verified route middleware.

https://github.com/jrean/laravel-user-verification

Socialite

Socialite offers a simple and easy way to handle OAuth authentication. It allows the users to login via some of the most popular social networks and services including Facebook, Twitter, Google, GitHub, and BitBucket.

https://github.com/laravel/socialite

Laravel Mix

Laravel Mix provides a clean and rich Application Programming Interface (API) for defining webpack-build steps for your project. It is the most powerful asset compilation tool available for Laravel today.

https://www.npmjs.com/package/laravel-mix

Migration Generator

Migration generator is a Laravel package that you can use to generate migrations from an existing database, including indexes and foreign keys.

https://github.com/Xethron/migrations-generator

Laravel Backup

This Laravel package creates a backup of all your files within an application. It creates a zip file that contains all files in the directories you specify along with a dump of your database. You can store a backup on any file system.

https://github.com/spatie/laravel-backup

No Captcha

No Captcha is a package for implementing Google reCaptcha validation and protecting forms from spamming. First, you need to obtain a free API key from reCaptcha.

https://github.com/anhskohbo/no-captcha

This is all for now.

Hope you enjoy that.

By Asahi



Laravel 9

It’s not officially release yet. It was originally scheduled to be released around September this year, but the Laravel team decided to release back to January 2022. Lets see what kinds of features might include in Laravel 9.

PHP Version

Laravel 9 requires Symfony 6.0 and has a minimum requirement of PHP 8,so I think the same rules will apply to Laravel 9.

Anonymous stub migrations

Laravel 8.37 announced a new feature called Anonymous Migration that avoids migration class name collisions.

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
 
return anoyclass extends Migration {
 
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('table', function (Blueprint $table) {
            $table->string('column');
        });
    }
};

A tidy design for routes:list

The route: list command has been in Laravel for a long time, and the problem I sometimes encounter is that if you have defined large and complex routes, trying to view them in the console can be complicated.

Screenshot 2022-01-05 at 13 57 23
Image credit: nunomaduro

New Query Builder Interface

Laravel 9 has a new QueryBuilder interface developed by Chris Morrell and you can see here for all the details.

For developers who rely on type hints for static analysis, refactoring, or code completion in their IDE, the lack of a shared interface or inheritance between Query\BuilderEloquent\Builder and Eloquent\Relation can be pretty tricky:

return Model::query()
  ->whereNotExists(function($query) {
    // $query is a Query\Builder
  })
  ->whereHas('relation', function($query) {
    // $query is an Eloquent\Builder
  })
  ->with('relation', function($query) {
    // $query is an Eloquent\Relation
  });

SwiftMailer to Symfony Mailer

Swift Mailer has been deprecated in Symfony and Laravel 9 will switch to using Symfony Mailer for all mail transport.

PHP String functions

Although PHP 8 will be the minimum, you can still use PHP string functions, str_contains()str_starts_with() and str_ends_with() internally in the \Illuminate\Support\Str class. You can check here for more detail.

There might be still many featuers going on and I guess laravel 9 is coming soon. When it releases, I might probably write another article relating with this.

Yuuma



Laravel 8.80でRoute Group Controllerを定義する

Laravelチームは、バージョン8.80をリリースしました。このバージョンでは、ルートグループコントローラーの定義、Bladeコンパイラーによる文字列のレンダリング、PHPRedisのシリアライズと圧縮設定のサポート、v8.xブランチの最新の変更点などを確認することができます。

ルートグループコントローラーを定義する

これは、ルートグループにコントローラを定義する機能で、グループが同じコントローラを使用する場合、ルートが使用するコントローラを繰り返す必要がないと言う意味です。

例: 

ブレードで文字列をレンダリング

Blade::render()は 、Blade コンパイラを使用して、Blade テンプレートの文字列をレンダリング文字列に変換します。

phpredis Serialization と Compression コンフィグサポート

このオプションは、Redis – Laravelのドキュメントに記載されるようになりました。

これは、PHPRedis のシリアライズや圧縮のオプションを設定する機能で、 サービスプロバイダを上書きしたりカスタムドライバを定義したりする必要がありません。

シリアライズオプションは以下の通りです。

  • NONE
  • PHP
  • JSON
  • IGBINARY
  • MSGPACK

そして、以下のコンプレッサーのオプションです。

  • NONE
  • LZF
  • ZSTD
  • LZ4

8.xのリリースノート

新機能やアップデート、8.79.0と8.80.0の差分はGitHubで確認できます。また、以下のリリースノートはチェンジログから直接引用しています。

ということで今回は以上になります。

最後までご高覧頂きまして有難うございました。

By Ami



4 mistakes that should be careful in NodeJS

Today, I would like to share about four common mistakes that should be careful when develop with NodeJS. Let’s take a look.

Blocking the Event Loop

Since Node JS comes with a single-threaded environment, no two parts of a Node JS application can run parallelly.

So, If the event loop is blocked, it causes blocking everything.

The solution is to use open-source modules like StrongOps.

StrongOps can identify and fix any delays in the event loop and prevent from blocking the event loop.

Trying to Execute Multiple Callbacks

Callbacks is used to allow asynchronous elements to communicate with each other.

However, executing the same callbacks or multiple callbacks all at once can cause interface freeze.

Therefore, it’s important to ensure you’re not continuously pressing for callbacks multiple times.

There are two ways to avoid that.

First, you can wrap the callback so you’ll be notified each time a callback is executed twice.

The second solution is to add a return before the callback to prevent invoking the same callback more than once.

Callback Hell

Callback Hell means  multiple nested callbacks that make nesting callbacks difficult and impossible to read & debug the written code.

There are many ways to keep the code easy-to-read and debug such as using promises.

A promise is basically a value returned to confirm the processing done by an asynchronous function. In simple terms, promises can be nested to make complex code look clear and easier to maintain.

Another way is to use the async module that provides a straight forward, powerful functions to work with asynchronous JavaScript.

Using Console.log for Debugging

Console.log in the NodeJS is to print almost anything to the console. When Console.log is used to debug, it restarts the server and slows down the performance of the application.

We can’t use console.log every time. So instead of console.log, we can use the Debug Library.

This is all for now.

Hope you enjoy that.

By Asahi



Demanding Technologies for developers in 2022

Regardless of your profession or designation, you must adapt to the constant changes that occur in your workplace. You need to learn new work skills through your work to adapt to changes in the workplace, develop your career, and promote career opportunities.

There might be plenty of trending and demanding technologies for 2022. I will describe a few which are demanding and also depending on my personal favors.

Artificial Intelligence (AI)

Artificial intelligence experts focus on building machines that are programmed to think like humans. These machines can perform tasks that require human intelligence. It exists a variety of actions related to human intelligence, such as knowledge representation, problem solving, learning, and reasoning.

AI has become so popular lately. The demand for professionals with knowledge, experience and skills in AI is very high. It goes without saying that careers in the field of AI have potential and are expected to continue in the future.

Blockchain

Blockchain is a digital ledger of transactions that is replicated and distributed thousands of times through a network of computer systems on the blockchain. This is the process of recording information in a way that makes system changes and hacks difficult or impossible.

Given the market trends, the demand for blockchain professionals continues to grow. If you have all the important blockchain-related tools and knowledge, you certainly have a brilliant career.

DevOps

A set of practices and tools that combine software development and IT operations to shorten the system development life cycle. Simply put, its goal is to make the software creation, testing, and launch process faster and more reliable.

DevOps experts are dedicated to creating software and verifying code versions to make sure everything goes smoothly. This is one of the most expensive remote jobs on the market.

AR & VR

Augmented reality (AR) and virtual reality (VR) are technologies that connect the real and virtual worlds. These technologies provide users with a visual view of information and content as if it were in the world. Many industries such as healthcare, travel, aviation and automotive are developing augmented reality solutions in training applications.

AR adds digital elements to live views to enhance the usefulness of digital devices in everyday tasks such as information retrieval and shopping. Virtual reality, on the other hand, allows users to experience what it is like to go anywhere.

While augmented reality provides an interactive experience of real-world scenarios, virtual reality creates a fully immersive virtual environment.

There are still other demanding techs like I said in above such as cyber security, robotics, machine learning etc. Wish everyone may be healthy and have a productive year.

Yuuma




アプリ関連ニュース

お問い合わせはこちら

お問い合わせ・ご相談はお電話、またはお問い合わせフォームよりお受け付けいたしております。

tel. 06-6454-8833(平日 10:00~17:00)

お問い合わせフォーム