flip() public method

Flip the items in the collection.
public flip ( ) : static
return static
Example #1
0
 public function testFlip()
 {
     $data = new Collection(['name' => 'taylor', 'framework' => 'laravel']);
     $this->assertEquals(['taylor' => 'name', 'laravel' => 'framework'], $data->flip()->toArray());
 }
 /**
  * Determine the locale from the current host.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return  string
  */
 public function determineLocale(Request $request)
 {
     return $this->hostMapping->flip()->get($request->getHost(), $this->fallback);
 }