public function run() { Bio::truncate(); $author = User::first(); $shortBio = $author->bios()->create(['nickname' => 'Short Bio', 'body' => 'I am short.']); $longBio = $author->bios()->create(['nickname' => 'Long Bio', 'body' => 'I am short and I love being short and this is very long.']); $author->bios()->saveMany([$shortBio, $longBio]); // Add a talk for user 2 for testing purposes $author = User::find(2); $trueBio = $author->bios()->create(['nickname' => 'True Bio', 'body' => 'I am a person.']); $falseBio = $author->bios()->create(['nickname' => 'False Bio', 'body' => 'I am an elephant.']); $author->bios()->saveMany([$trueBio, $falseBio]); }
</div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li><a href="bio.php"><span class="glyphicon glyphicon-leaf"></span> A propos</a></li> </ul> </div><!-- /.navbar-collapse --> </div><!-- /.container-fluid --> </nav> <div class="container"> <?php require_once 'php/bio.class.php'; $bio = new Bio(); $dir = 'uploads'; if (!is_dir($dir)) { mkdir($dir); } $gallery = scandir($dir); $gallery_list = array(); $cpt = 0; foreach ($gallery as $value) { if ($value != '.' && $value != '..') { $gallery_list[$cpt]['image'] = 'uploads/' . $value; $gallery_list[$cpt]['thumb'] = '../../../../uploads/' . $value; $cpt++; } } $json = json_encode($gallery_list);
public function testCannotFetchOneBioForOtherUser() { $bioId = Bio::where('user_id', 2)->first()->id; $response = $this->call('GET', 'api/bios/' . $bioId); $this->assertEquals(404, $response->getStatusCode()); }
</div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li><a href="bio.php"><span class="glyphicon glyphicon-leaf"></span> A propos</a></li> </ul> </div><!-- /.navbar-collapse --> </div><!-- /.container-fluid --> </nav> <div class="container"> <?php require_once 'php/bio.class.php'; $bio = new Bio(); $bio->getBio(); ?> </div> <!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> <script src="js/jquery.min.js"></script> <!-- Include all compiled plugins (below), or include individual files as needed --> <script src="style/bootstrap/js/bootstrap.min.js"></script> <script src="js/index.js"></script> <script type="text/javascript"> $( 'img' ).each(function(){ var style = $( this ).attr('style'); var styles = ""; var split = style.split('; ');
public function getBio() { $bio = new Bio(); return $bio->getBio(); }
public function Children() { return Bio::get()->filter(array('BioPageID' => $this->ID))->sort('LastName ASC'); }