protected static function boot() { parent::boot(); self::saving(function ($channel) { if ($channel->code == null) { $channel->code = \Str::slug($channel->name); } }); if (strstr(\Url::current(), \Backend::baseUrl())) { self::backendBoot(); } }