getUrl() public method

Get the url for this book.
public getUrl ( string | boolean $path = false ) : string
$path string | boolean
return string
示例#1
0
 public function chapterCreation(\BookStack\Book $book)
 {
     $chapter = factory(\BookStack\Chapter::class)->make(['name' => 'My First Chapter']);
     $this->asAdmin()->visit($book->getUrl())->click('New Chapter')->seePageIs($book->getUrl() . '/chapter/create')->type($chapter->name, '#name')->type($chapter->description, '#description')->press('Save Chapter')->seePageIs($book->getUrl() . '/chapter/my-first-chapter')->see($chapter->name)->see($chapter->description);
     $chapter = \BookStack\Chapter::where('slug', '=', 'my-first-chapter')->where('book_id', '=', $book->id)->first();
     return $chapter;
 }