Adding estimated time to read an article in Laravel

If you’re wondering how to do that, the short answer is here: we are going to use one private method and Laravel Accessor. Don’t be afraid, it’s pretty simple. First off, we’re going to count seconds and minutes to read using this formula: Let’s make a whole function using that formula and put in into […]

How to use a relationship in Laravel Accessor

Imagine, you have to use a relation within your Model Accessor. Let’s see our Post Model example: As you see, we reference the relation with this code – $this->platform->name. Don’t forget that you have to “camel case” seoTitle for your accessor method name, and use it as a “snake case” seo_title in your Blade file […]