/** * Test for string ends with * @param $haystack * @param $needle * @return bool */ function str_ends_with($haystack, $needle) { return Str::endsWith($haystack, $needle); }
/** * Parse the connection into an array of the name and read / write type. * * @param string $name * @return array */ protected function parseConnectionName($name) { $name = $name ?: $this->getDefaultConnection(); return Str::endsWith($name, ['::read', '::write']) ? explode('::', $name, 2) : [$name, null]; }