<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>shonansurvivors</author_name>
  <author_url>https://blog.hatena.ne.jp/shonansurvivors/</author_url>
  <blog_title>やんばるテック</blog_title>
  <blog_url>https://blog.shonansurvivors.com/</blog_url>
  <categories>
    <anon>Laravel</anon>
  </categories>
  <description>はじめに Laravelのアクセサを使うことで、モデルのプロパティ(テーブルのカラム)を、オリジナルの値から別の値に変換して取得することが可能となります。 本記事では、このアクセサの利用例を解説します。 目次 はじめに 目次 環境 事例 アクセサの実装 アクセサの利点 余談 参考 環境 Laravel 5.5.45 事例 例えば、ブログに付けられたコメントの公開が、ブログ管理者による承認制であるブログシステムがあったとして、各コメントが承認済であるかどうかが、commentsテーブルのapproved_at(承認日時)カラムの値の有無で判断できるとします。 approved_at(承認日時) …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.shonansurvivors.com%2Fentry%2Flaravel-accessor&quot; title=&quot;【Laravel】アクセサの使い方 - やんばるテック&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2019-10-27 00:00:00</published>
  <title>【Laravel】アクセサの使い方</title>
  <type>rich</type>
  <url>https://blog.shonansurvivors.com/entry/laravel-accessor</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
