Example #1
0
 public function grow()
 {
     foreach ($this->paintings as $painting) {
         $p = new Painting();
         $p->name = $painting['name'];
         $p->dimensions = $painting['dimensions'];
         $p->type = $painting['type'];
         $p->painter = $painting['painter'];
         $p->year = $painting['year'];
         $p->comment = $painting['comment'];
         $p->image_path = $painting['image_path'];
         $p->save();
         $p->tag($this->getTags());
     }
 }
Example #2
0
    
        Schema::table('art', function($newtable)
        {
            $newtable->boolean('alumni');
            $newtable->dropColumn('exhibition_date');
        });
    */
    $theLandmarks = array("St. Marks", "Brooklyn Heights", "Central Park", "Times Square");
    return View::make('hello', array('theLocation' => 'NYC', 'theWeather' => 'stormy', 'theLandmarks' => $theLandmarks));
});
Route::get('insert', function () {
    $painting = new Painting();
    $painting->title = 'Do No Wrong';
    $painting->artist = "D. DoRight";
    $painting->year = 2014;
    $painting->save();
    return 'Record Inserted Succefully.';
});
Route::get('find', function () {
    $painting = Painting::find(2);
    return $painting->title;
});
Route::get('change', function () {
    $painting = Painting::find(2);
    $painting->title = 'Be Successful';
    $painting->save();
    return 'Title changed to ' . $painting->title;
});
Route::get('about', function () {
    return 'This is the About Page.';
});