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