12345678910111213141516171819 |
- <?php
- namespace App\Casts;
- use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
- class HttpToHttps implements CastsAttributes
- {
- public function get($model, string $key, $value, array $attributes)
- {
- $value = str_replace('http://','https://',$value);
- return str_replace('-internal','',$value);
- }
- public function set($model, string $key, $value, array $attributes)
- {
- $value = str_replace('http://','https://',$value);
- return str_replace('-internal','',$value);
- }
- }
|