技術情報

知っておいていただきたいこと – 7

今回も、Laravelの知っておいた方がいいとおもったことをいくつか紹介します。

#Laravel #Implicit Binding

Implicit Bindingは、ルートやコントローラのアクションで定義されたEloquentモデルを自動的に解決します。

Laravel 5.3で導入されましたが、もっと多くの人に知ってもらいたい素晴らしい機能です。

//Implicit route model binding
Route::get('api/posts/{post}', function (App\Post $post) {
    return $post->title;
});

ということで、今回はこれで終わります。

金曜担当 – Ami



3 Ways to group routes in laravel

Today, I would like to share about 3 ways to group routes in laravel. Let’s take a look.

1. Route::resource

We can create a resource controller and group routes for CRUD actions of that controller as follow.

Route::resource('books', BookController::class);

2. Route groups within another route group

We can groups routes within another route groups like nested ones.

Route::middleware('auth')->group(function() {
 
    Route::middleware('admin')->prefix('admin')->group(function() {
    	Route::get(...) 
    });
 
    Route::middleware('member')->prefix('member')->group(function() {
    	Route::get(...) 
    });
});

3. Route::controller() in Laravel 9

In laravel 9, we can group the routes without repeating controller name for the same controller.

Route::controller(PostController::class)->group(function() {
    Route::get('posts', 'getPosts');
    Route::put('posts/update', 'updatePost');
    Route::delete('posts/delete/{id}', 'deletePost');
});

This is all for now. Hope you enjoy that.

By Asahi



Differences Between Free SSL and Paid SSL

Today, I would like to share about differences between free and paid SSL. Let’s take a look.

When we deploy our website or web applications in production, we have to install SSL certificates for our website’s security. They come both free and paid. The followings are the differences of free and paid SSL.

1. Free SSL certificates only support DV (Domain Validation), not for EV(Extended Validation) and OV(Organization Validation).

2. Free SSL certificates validate only the ownership of the domain whereas paid SSL certificates verify the business identity of the website and with OV & EV certificates, it has in-depth verification by the certificate authority(CA).

3. Free SSL certificates are issued for 30-90 days and paid SSL certificates are for 1-2 years.

4. Free SSL certificates do not provide warranty when there are something wrong or errors on certificates authentication. But paid SSL certificates provide warranty limits.

5. Free SSL cerificate authorities(CAs) do not support customer services whereas paid SSL certificate authorities(CAs) support customer services.

This is all for now. Hope you enjoy that.

By Asahi



知っておいていただきたいこと – 6

今回も、Laravelの知っておいた方がいいとおもったことをいくつか紹介します。

#Laravel Tip – join

Laravelの最新リリースでは、Arrファサードに新しい「join」メソッドが追加され、アイテムの配列を文としてフォーマットできるようになりました。このメソッドにより、配列を文としてフォーマットすることができます。

$team = ['John', 'Smith', 'Jesse', 'Bryan'];
$formatted = Arr::join(
  $team,
  ', ',
  ' and '
);

echo "Such a fascinated team - {$formatted}!!";
//Such a fascinated team - John, Smith, Jesse and Bryan!!

ということで、今回はこれで終わります。

金曜担当 – Ami



[Laravel] Auth 機能とMiddlewareの設定(1)

今回はLaravel標準の認証機能とMiddlewareによる認証チェック機能についての情報を
シェアしたいと思います。

続きを読む


アプリ関連ニュース

お問い合わせはこちら

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

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

お問い合わせフォーム