public function testBeginsWith() { $this->assertEqualsMatrix([[true, Str::beginsWith('hello world', 'hello')], [true, Str::beginsWith('hello world', '')], [false, Str::beginsWith('hello world', 'omg')], [false, Str::beginsWith('hello world', 'hello world ')]]); }
/** * Get all the API ResourceFactories for this application. * * @return ResourceFactory[] */ public function getApiResources() { return Std::filter(function (ResourceFactory $resource) { foreach ($this->getApiPrefixes() as $prefix) { if (Str::beginsWith($resource->getPrefix(), $prefix)) { return true; } } return false; }, $this->getResources()); }