-
Upgrade to PHP8.0 and install Laravel8 on EC2 (Amazon Linux2)
I upgraded PHP7.2 to PHP8.0 on EC2 using Amazon Linux2 and installed Laravel8.Here is how I did it. 【Command to use】 The following is a list of commands used in this article with a light explanation.If you are in a hurry, please refer ... -
【Next.js】useSWR()でPOSTする
useSWR()を使ってデータを取得するには以下の方法で取得できました。 const commentsFetcher = (url: string): Promise<fetchCommentsReturnType> => axios(url).then((res) => res.data); const { data: comments, error:commentsError } = u... -
【Next.js】axiosを使ってSWRで取得する
Next.jsのSWRでデータを取得するときにaxiosを使った方法をご紹介します。 APIサーバーはLaravelを想定しています。また、Laravelでデータを返すときはEloquentのAPI Resourcesを使用しているものとします。 https://laravel.com/docs/8.x/eloquent-resour... -
Laravel でtwitterのフォロー機能を実装する
Laravelでtwitterのフォローのような機能を作る時は、以下のようなパッケージをcomposerでインストールして実装ができます。 overtrue/laravel-followhareku/laravel-follow しかし、このようなパッケージを入れなくてもtwitterのようなフォロー機能をシン... -
Laravelでリレーションの外部キーにnullを許可する
この記事でLaravelのリレーションで外部キーにnullを許可する以下の2つの方法をご紹介します。 バージョンに関係ない共通の書き方Laravel >= 7.x でforeignId()を使う方法 Laravel >= 7.x を使っている場合はforeignId()を使用した方法をおすすめし... -
EC2のLaravelにintervention/imageをインストール
あるウェブサービスで容量の大きい画像(2〜数十MB)の画像加工をして保存するロジックで、 「500 リクエストを処理できません。」 とエラーが出て画像を加工・保存できないことがあります。 この記事ではLaravelでintervention/imageを使って画像を加工・... -
EC2(Amazon Linux2)でPHP8.0にバージョンアップしてLaravelをインストール
Amazon Linux2を使ったEC2のPHP7.2をPHP8.0にバージョンアップしてLaravelをインストールしました。その方法をご紹介します。 【使用するコマンド】 この記事内で使用するコマンドを軽い説明付きでまとめました。お急ぎの方は以下のコマンドを参考にしてく... -
Controlling Material UI v4 Form with React Hook Form v7
In this article, I will show you how to control a Material UI v4 form with React Hook Form v7. Material UI's TextField, Radio, and Select work just fine, but Checkbox requires some tricks and ingenuity.Here is a sample code for your refe... -
Controlling Material UI v4’s Checkbox with React Hook Form v7
In Controlling Material UI's Checkbox with React Hook Form, I introduced how to control Material UI's Checkbox with React Hook Form v6. After that, React Hook Form v7 was released.The way to control Material-UI has changed a little in Re... -
How to use Next.js and Material-UI’s Link together
Next.js links and Material-UI links cannot normally be used together.However, with a little ingenuity, they can be used together. The following are the requirements for the Link component that we will create using Next.js and Material-UI...