public function testKebabCase() { $this->assertEquals('foo-bar', Str::snake('Foo Bar', '-')); $this->assertEquals('foo-bar', Str::snake('foo bar', '-')); $this->assertEquals('foo-bar', Str::snake('FooBar', '-')); $this->assertEquals('foo-bar', Str::snake('fooBar', '-')); $this->assertEquals('foo-bar', Str::snake('foo-bar', '-')); $this->assertEquals('foo-bar', Str::snake('foo_bar', '-')); $this->assertEquals('foo-bar', Str::snake('FOO_BAR', '-')); $this->assertEquals('foo-bar', Str::snake('fooBar', '-')); $this->assertEquals('foo-bar', Str::snake('fooBar', '-')); // test cache }
/** * Dynamically bind parameters to the view. * * @param string $method * @param array $parameters * * @throws \BadMethodCallException * * @return \Viserio\View\View */ public function __call(string $method, array $parameters) : ViewContract { if (Str::startsWith($method, 'with')) { return $this->with(Str::snake(substr($method, 4)), $parameters[0]); } throw new BadMethodCallException(sprintf('Method [%s] does not exist on view.', $method)); }