public function testDestroy()
 {
     $this->testCreateNew();
     //Create new first
     $promotion = Promotion::find('1');
     $promotion->delete();
     $result = Promotion::find('1');
     $this->assertTrue($result == null);
 }
 public function getDelete($id)
 {
     // Find the promotion using the id
     $promotion = Promotion::find($id);
     // Delete all images
     $promotion->deleteAllImages();
     // Delete the promotion
     $promotion->delete();
     return Redirect::to('admin/promotions');
 }
Example #3
0
 public static function getAllActiveOrdered()
 {
     return Promotion::where('active', '=', '1')->orderBy('start_date', 'desc')->orderBy('name')->get();
 }