public function login()
 {
     $account = Input::get('account');
     $password = Input::get('password');
     if (!isset($account)) {
         return Response::json(array('error_code' => 1, 'message' => '请输入账户'));
     }
     if (!isset($password)) {
         return Response::json(array('error_code' => 2, 'message' => '请输入密码'));
     }
     $user = User::where('account', $account)->first();
     if (!isset($user)) {
         return Response::json(array('error_code' => 3, 'message' => '用户名不存在'));
     }
     if (!($user->role & 0x2)) {
         return Response::json(array('error_code' => 4, 'message' => '无效用户'));
     }
     try {
         Sentry::authenticate(array('phone' => $user->phone, 'password' => $password));
     } catch (Cartalyst\Sentry\Users\UserNotFoundException $e) {
         return Response::json(array('error_code' => 5, 'message' => '用户名或密码错误'));
     } catch (Cartalyst\Sentry\Users\PasswordRequiredException $e) {
         return Response::json(array('error_code' => 5, 'message' => '用户名或密码错误'));
     }
     $doctor = Doctor::where('user_id', $user->id)->first();
     Session::put('user.id', $user->id);
     Session::put('doctor.id', $doctor->id);
     Session::put('doctor.name', $doctor->name);
     Session::put('doctor.photo', $doctor->photo);
     return Response::json(array('error_code' => 0, 'message' => '登录成功'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function getDoctorHistory()
 {
     $id = Doctor::doctorLogin();
     $doctor = Doctor::where('id', $id)->first();
     $payments = Userpayment::where('user_id', $doctor->user_id)->where('paid', 1)->get();
     return View::make('clinic.doctor.Payment.History')->with('payments', $payments);
 }
 public function account()
 {
     $doctor = Doctor::where('user_id', Session::get('user.id'))->first();
     $hospital_id = $doctor->department->hospital_id;
     $default_department = $doctor->department_id;
     $departments = Department::where('hospital_id', $hospital_id)->get();
     $render_data = array('name' => $doctor->name, 'photo' => $doctor->photo, 'title' => $doctor->title, 'specialty' => strip_tags($doctor->specialty), 'description' => strip_tags($doctor->description), 'default_department' => $doctor->department_id, 'departments' => $departments, 'top_photo' => Session::get('doctor.photo'));
     return View::make('doctor.account', $render_data);
 }
示例#4
0
 public function login()
 {
     $name = Input::get('name');
     $reg_id = Input::get('reg_id');
     try {
         $doctor = Doctor::where('name', '=', $name)->where('reg_id', '=', $reg_id)->firstOrFail();
         return Response::data($doctor);
     } catch (ModelNotFoundException $e) {
         return Response::unauthorized();
     }
 }
示例#5
0
 public static function VeryTypeDoctor()
 {
     if ($user = Sentry::getUser()) {
         $doctors = Doctor::where('user_id', $user->id)->first();
         if ($doctors) {
             if ($doctors->clinic_id > 0) {
                 return true;
             }
         }
     }
 }
 public static function doctorNegocios()
 {
     $user = Sentry::getUser();
     $doctors = Doctor::where('user_id', $user->id)->first();
     $business = BusinessDoctor::where('doctor_id', $doctors->id)->get();
     if ($business) {
         return $business;
     } else {
         return false;
     }
 }
示例#7
0
 public static function getVeryAgenda($agenda_id)
 {
     $user = Sentry::getUser();
     $doctor = Doctor::where('user_id', $user->id)->first();
     $agenda = Agenda::find($agenda_id);
     if ($agenda->doctor_id == $doctor->id) {
         return true;
     } else {
         return false;
     }
 }
 public function run()
 {
     DB::table('enemies')->delete();
     DB::table('doctor_enemy')->delete();
     // Pull up the doctors to attach to companions
     $doctorNine = Doctor::where('number', 9)->first();
     $doctorTen = Doctor::where('number', 10)->first();
     $doctorEleven = Doctor::where('number', 11)->first();
     $doctorTwelve = Doctor::where('number', 12)->first();
     Enemy::create(array('name' => 'Cybermen', 'description' => 'Originally born on Earth’s twin planet Mondas, the Cybermen were created as the Mondasians replaced parts of their dying bodies with plastic and steel. Eventually they added emotional inhibitors, supressing all feelings – love, hate, even fear. Cybermen can convert humans wherever they go, and take orders from a Cyberleader, whose data can be downloaded to a drone if the leader is destroyed. Like the Daleks, the Cybermen have dogged the Doctor through space and time. He has prevented them destroying Earth’s weather system, getting their hands on the Nemesis statue and taking over Victorian London with their Cyber-King. The Tenth Doctor visited a parallel universe, where Cybus Industries had developed Cybermen to prolong John Lumic’s dwindling life.', 'image' => 'http://thedoctor.coderfaire/assets/img/enemies/cybermen.png'))->doctors()->attach([$doctorTen->id, $doctorEleven->id]);
     Enemy::create(array('name' => 'Daleks', 'description' => 'The Doctor first encountered the Daleks on the radiation-soaked planet of Skaro, waging war with the peaceful Thals. The Daleks were the mangled and mutated remains of the Kaled people, placed in metal war machines by the Kaled’s chief scientist Davros. Pursuing the Doctor across space and time, the Daleks invaded the Earth, developed the Reality Bomb and tried to imprison the Doctor in the Pandorica. They fought the Time Lords in The Last Great Time War – a conflict so powerful and destructive that the universe was said to convulse. In an effort to save reality, the Doctor used ‘the Moment’ to annihilate both races. But that wasn’t the end of the Daleks...', 'image' => 'http://thedoctor.coderfaire/assets/img/enemies/daleks.png'))->doctors()->attach([$doctorNine->id, $doctorTen->id, $doctorEleven->id, $doctorTwelve->id]);
     Enemy::create(array('name' => 'Sontarans', 'description' => 'An aggressive clone-warrior race from Sontar, who travel in spherical ships, the Sontarans were engaged in a war lasting many thousands of years with the Rutans. In pursuit of the advantage, Commander Linx of the Fifth Sontaran Battle Group tried to invade 13th century Earth, until repelled by the Third Doctor. Later meetings with the Doctor saw the Sontarans invading the Time Lord home planet of Gallifrey, forcing the Sixth Doctor to build them a time travel machine, and trying to covert Earth’s atmosphere into one suitable for warrior cloning using the ATMOS machines. Sarah Jane Smith later encountered – and defeated – the last survivor of that invasion, Commander Kaagh.', 'image' => 'http://thedoctor.coderfaire/assets/img/enemies/sontarans.png'))->doctors()->attach([$doctorTen->id, $doctorEleven->id]);
     Enemy::create(array('name' => 'The Silence', 'description' => 'Rather than a specific race, The Silence are a religious order. Their agents on Earth have been there since before the dawn of mankind, directing human evolution. They use post-hypnotic suggestion to make people who see them instantly forget their existence. They believe that silence must fall when the oldest Question in the universe is asked. It will be asked at “the fall of the Eleventh” on the Fields of Trenzalore, and is hidden in plain sight. As a result, the Silence have tried to stop the Doctor reaching Trenzalore. They used their agent Madame Kovarian to kidnap Melody Pond, and raised her as the Doctor’s perfect assassin. Despite the failure of this plan, the Silence remain at large, determined to stop the Question ever being asked.', 'image' => 'http://thedoctor.coderfaire/assets/img/enemies/the-silence.png'))->doctors()->attach([$doctorEleven->id]);
     Enemy::create(array('name' => 'Weeping Angels', 'description' => 'Known as “The Lonely Assassins”, the Weeping Angels are quantum-locked alien killers, as old as the universe itself. Little is known of their origins or culture. When observed, they freeze like stone, but in the blink of an eye they can move vast distances. The touch of an Angel hurls their victim back in time – allowing the Angel to feast on the energy of their unlived days. Initially, the Tenth Doctor encountered four Angels, who sent him back to 1969. He left clues for Sally Sparrow to find and help trap them – releasing him and the TARDIS. Later encounters have seen a whole mausoleum of statues, tiny cherubs and even the Statue of Liberty transformed into Weeping Angels. Both Amy and Rory were trapped by a Weeping Angel, when it sent them back to 1938 to live out their lives together. In the 51st Century, the Doctor trapped the Angels in a crack in time, erasing them from history.', 'image' => 'http://thedoctor.coderfaire/assets/img/enemies/weeping-angels.png'))->doctors()->attach([$doctorTen->id, $doctorEleven->id]);
 }
 public function run()
 {
     DB::table('ratings')->delete();
     // Going to randomize all our ratings for our users, so throw everything in
     // an array.
     $toRate = array(array('item' => Doctor::where('number', 9)->first(), 'type' => 'doctor'), array('item' => Doctor::where('number', 10)->first(), 'type' => 'doctor'), array('item' => Doctor::where('number', 11)->first(), 'type' => 'doctor'), array('item' => Doctor::where('number', 12)->first(), 'type' => 'doctor'), array('item' => Enemy::where('name', 'Cybermen')->first(), 'type' => 'enemy'), array('item' => Enemy::where('name', 'Daleks')->first(), 'type' => 'enemy'), array('item' => Enemy::where('name', 'Sontarans')->first(), 'type' => 'enemy'), array('item' => Enemy::where('name', 'The Silence')->first(), 'type' => 'enemy'), array('item' => Enemy::where('name', 'Weeping Angels')->first(), 'type' => 'enemy'), array('item' => Companion::where('name', 'Amy Pond')->first(), 'type' => 'companion'), array('item' => Companion::where('name', 'Captain Jack')->first(), 'type' => 'companion'), array('item' => Companion::where('name', 'Clara Oswald')->first(), 'type' => 'companion'), array('item' => Companion::where('name', 'Donna Noble')->first(), 'type' => 'companion'), array('item' => Companion::where('name', 'Martha Jones')->first(), 'type' => 'companion'), array('item' => Companion::where('name', 'Mickey Smith')->first(), 'type' => 'companion'), array('item' => Companion::where('name', 'River Song')->first(), 'type' => 'companion'), array('item' => Companion::where('name', 'Rory Williams')->first(), 'type' => 'companion'), array('item' => Companion::where('name', 'Rose Tyler')->first(), 'type' => 'companion'), array('item' => Companion::where('name', 'Wilfred Mott')->first(), 'type' => 'companion'), array('item' => Episode::where('season', 1)->where('episode', 1)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 1)->where('episode', 6)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 1)->where('episode', 10)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 1)->where('episode', 12)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 2)->where('episode', 5)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 2)->where('episode', 12)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 3)->where('episode', 9)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 3)->where('episode', 10)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 4)->where('episode', 4)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 4)->where('episode', 13)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 5)->where('episode', 3)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 5)->where('episode', 4)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 5)->where('episode', 12)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 6)->where('episode', 1)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 6)->where('episode', 10)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 6)->where('episode', 13)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 7)->where('episode', 5)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 7)->where('episode', 12)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 8)->where('episode', 2)->first(), 'type' => 'episode'));
     $users = User::get();
     // Loop through our users
     foreach ($users as $user) {
         // Loop through things to be rated
         foreach ($toRate as $item) {
             $rating = rand(1, 5);
             Rating::create(array('user_id' => $user->id, 'item_id' => $item['item']->id, 'item_type' => $item['type'], 'rating' => $rating));
         }
     }
 }
示例#10
0
 public function run()
 {
     DB::table('comments')->delete();
     // Going to randomize all our ratings for our users, so throw everything in
     // an array.
     $toComment = array(array('item' => Doctor::where('number', 9)->first(), 'type' => 'doctor'), array('item' => Doctor::where('number', 10)->first(), 'type' => 'doctor'), array('item' => Doctor::where('number', 11)->first(), 'type' => 'doctor'), array('item' => Doctor::where('number', 12)->first(), 'type' => 'doctor'), array('item' => Enemy::where('name', 'Cybermen')->first(), 'type' => 'enemy'), array('item' => Enemy::where('name', 'Daleks')->first(), 'type' => 'enemy'), array('item' => Enemy::where('name', 'Sontarans')->first(), 'type' => 'enemy'), array('item' => Enemy::where('name', 'The Silence')->first(), 'type' => 'enemy'), array('item' => Enemy::where('name', 'Weeping Angels')->first(), 'type' => 'enemy'), array('item' => Companion::where('name', 'Amy Pond')->first(), 'type' => 'companion'), array('item' => Companion::where('name', 'Captain Jack')->first(), 'type' => 'companion'), array('item' => Companion::where('name', 'Clara Oswald')->first(), 'type' => 'companion'), array('item' => Companion::where('name', 'Donna Noble')->first(), 'type' => 'companion'), array('item' => Companion::where('name', 'Martha Jones')->first(), 'type' => 'companion'), array('item' => Companion::where('name', 'Mickey Smith')->first(), 'type' => 'companion'), array('item' => Companion::where('name', 'River Song')->first(), 'type' => 'companion'), array('item' => Companion::where('name', 'Rory Williams')->first(), 'type' => 'companion'), array('item' => Companion::where('name', 'Rose Tyler')->first(), 'type' => 'companion'), array('item' => Companion::where('name', 'Wilfred Mott')->first(), 'type' => 'companion'), array('item' => Episode::where('season', 1)->where('episode', 1)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 1)->where('episode', 6)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 1)->where('episode', 10)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 1)->where('episode', 12)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 2)->where('episode', 5)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 2)->where('episode', 12)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 3)->where('episode', 9)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 3)->where('episode', 10)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 4)->where('episode', 4)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 4)->where('episode', 13)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 5)->where('episode', 3)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 5)->where('episode', 4)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 5)->where('episode', 12)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 6)->where('episode', 1)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 6)->where('episode', 10)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 6)->where('episode', 13)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 7)->where('episode', 5)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 7)->where('episode', 12)->first(), 'type' => 'episode'), array('item' => Episode::where('season', 8)->where('episode', 2)->first(), 'type' => 'episode'));
     $titles = array('Fabulous!', 'My favorite!', 'This stank more than anything has stunk before', 'This one put me to sleep', 'Stay away', 'Not impressed', 'Vote for Pedro', 'Cheap Wristwatch', 'I hope to see this again', 'Blew my mind', 'Ripoff', 'The old one was better', 'Better than ever');
     $comments = array("It's time to play the music. It's time to light the lights. It's time to meet the Muppets on the Muppet Show tonight. Movin' on up to the east side. We finally got a piece of the pie. Doin' it our way. There's nothing we wont try. Never heard the word impossible. This time there's no stopping us. The first mate and his Skipper too will do their very best to make the others comfortable in their tropic island nest. I have always wanted to have a neighbor just like you. I've always wanted to live in a neighborhood with you. Straightnin' the curves. Flatnin' the hills Someday the mountain might get ‘em but the law never will. Well the first thing you know ol' Jeds a millionaire. Kinfolk said Jed move away from there. black gold.\" Fish don't fry in the kitchen and beans don't burn on the grill. Took a whole lotta tryin' just to get up that hill.", "But they got diff'rent strokes. It takes diff'rent strokes - it takes diff'rent strokes to move the world. You wanna be where you can see our troubles are all the same. You wanna be where everybody knows Your name. Then one day he was shootin' at some food and up through the ground came a bubblin' crude. Oil that is It's time to put on makeup. It's time to dress up right. It's time to raise the curtain on the Muppet Show tonight. They were four men living all together yet they were all alone. Come and listen to a story about a man named Jed - a poor mountaineer barely kept his family fed. The year is 1987 and NASA launches the last of Americas deep space probes. The Brady Bunch the Brady Bunch that's the way we all became the Brady Bunch? It's time to put on makeup. It's time to dress up right. It's time to raise the curtain on the Muppet Show tonight. Here's the story of a lovely lady who was bringing up three very lovely girls. Here he comes Here comes Speed Racer. He's a demon on wheels!", "Fleeing from the Cylon tyranny the last Battlestar – Galactica - leads a rag-tag fugitive fleet on a lonely quest - a shining planet known as Earth. So lets make the most of this beautiful day. Since we're together The movie star the professor and Mary Ann here on Gilligans Isle. Wouldn't you like to get away? Sometimes you want to go where everybody knows your name. And they're always glad you came. We're gonna do it. On your mark get set and go now. Got a dream and we just know now we're gonna make our dream come true. Goodbye gray sky hello blue. There's nothing can hold me when I hold you. Feels so right it cant be wrong. Rockin' and rollin' all week long. Sunny Days sweepin' the clouds away. On my way to where the air is sweet. Can you tell me how to get how to get to Sesame Street? And if you threw a party - invited everyone you knew. You would see the biggest gift would be from me and the card attached would say thank you for being a friend. Well we're movin' on up to the east side. To a deluxe apartment in the sky. Knight Rider: A shadowy flight into the dangerous world of a man who does not exist. Believe it or not I'm walking on air. I never thought I could feel so free.", "Baby if you've ever wondered - wondered whatever became of me. I'm living on the air in Cincinnati. Cincinnati WKRP. Didn't need no welfare states. Everybody pulled his weight. Gee our old Lasalle ran great. Those were the days. And if you threw a party - invited everyone you knew. You would see the biggest gift would be from me and the card attached would say thank you for being a friend. Come and listen to a story about a man named Jed - a poor mountaineer barely kept his family fed! One two three four five six seven eight Sclemeel schlemazel hasenfeffer incorporated. black gold But they got diff'rent strokes. It takes diff'rent strokes - it takes diff'rent strokes to move the world.", "All of them had hair of gold like their mother the youngest one in curls! All of them had hair of gold like their mother the youngest one in curls. Believe it or not I'm walking on air. I never thought I could feel so free. Just two good ol' boys Never meanin' no harm. Beats all you've ever saw been in trouble with the law since the day they was born. The ship set ground on the shore of this uncharted desert isle with Gilligan the Skipper too the millionaire and his wife. Doin' it our way. Nothin's gonna turn us back now. Straight ahead and on the track now. We're gonna make our dreams come true. If you have a problem if no one else can help and if you can find them maybe you can hire The A-Team!", "If you have a problem if no one else can help and if you can find them maybe you can hire The A-Team. But they got diff'rent strokes. It takes diff'rent strokes - it takes diff'rent strokes to move the world. Now the world don't move to the beat of just one drum. What might be right for you may not be right for some.", "Were gonna do it. Give us any chance well take it. Give us any rule we'll break it. We're gonna make our dreams come true. Why do we always come here? I guess well never know. Its like a kind of torture to have to watch the show.", "black gold Why do we always come here? I guess well never know. Its like a kind of torture to have to watch the show. Here's the story of a lovely lady who was bringing up three very lovely girls. They were four men living all together yet they were all alone. Maybe you and me were never meant to be. But baby think of me once in awhile. I'm at WKRP in Cincinnati. The Brady Bunch the Brady Bunch that's the way we all became the Brady Bunch. Believe it or not I'm walking on air. I never thought I could feel so free. And we'll do it our way yes our way. Make all our dreams come true for me and you. Come and knock on our door. We've been waiting for you. Where the kisses are hers and hers and his. Three's company too? Texas tea., Till the one day when the lady met this fellow and they knew it was much more than a hunch. It's a beautiful day in this neighborhood a beautiful day for a neighbor. Would you be mine? Could you be mine? Its a neighborly day in this beautywood a neighborly day for a beauty. Would you be mine? Could you be mine. On the most sensational inspirational celebrational Muppetational… This is what we call the Muppet Show.", "The movie star the professor and Mary Ann here on Gilligans Isle. They're creepy and they're kooky mysterious and spooky. They're all together ooky the Addams Family. They call him Flipper Flipper faster than lightning. No one you see is smarter than he. The first mate and his Skipper too will do their very best to make the others comfortable in their tropic island nest. So get a witch's shawl on a broomstick you can crawl on. Were gonna pay a call on the Addams Family. Now the world don't move to the beat of just one drum. What might be right for you may not be right for some. Believe it or not I'm walking on air. I never thought I could feel so free. Flying away on a wing and a prayer. Who could it be? Believe it or not its just me. Doin' it our way. There's nothing we wont try. Never heard the word impossible. This time there's no stopping us.", "Movin' on up to the east side. We finally got a piece of the pie. Come and knock on our door. We've been waiting for you. Where the kisses are hers and hers and his. Three's company too. Just two good ol' boys Wouldn't change if they could. Fightin' the system like a true modern day Robin Hood. Space. The final frontier. These are the voyages of the Starship Enterprise. Doin' it our way. Nothin's gonna turn us back now. Straight ahead and on the track now. We're gonna make our dreams come true. Michael Knight a young loner on a crusade to champion the cause of the innocent. The helpless. The powerless in a world of criminals who operate above the law.", "Texas tea. I have always wanted to have a neighbor just like you. I've always wanted to live in a neighborhood with you? No phone no lights no motor car not a single luxury. Like Robinson Crusoe it's primitive as can be. black gold. And when the odds are against him and their dangers work to do. You bet your life Speed Racer he will see it through. we might as well say... Would you be mine? Could you be mine? Won't you be my neighbor. One two three four five six seven eight Sclemeel schlemazel hasenfeffer incorporated., It's time to put on makeup. It's time to dress up right. It's time to raise the curtain on the Muppet Show tonight!", "Goodbye gray sky hello blue. There's nothing can hold me when I hold you. Feels so right it cant be wrong. Rockin' and rollin' all week long. The mate was a mighty sailin' man the Skipper brave and sure. Five passengers set sail that day for a three hour tour a three hour tour.", "Knight Rider: A shadowy flight into the dangerous world of a man who does not exist. It's time to put on makeup. It's time to dress up right. It's time to raise the curtain on the Muppet Show tonight. The Brady Bunch the Brady Bunch that's the way we all became the Brady Bunch. Just two good ol' boys Wouldn't change if they could. Fightin' the system like a true modern day Robin Hood.", "So this is the tale of our castaways they're here for a long long time. They'll have to make the best of things its an uphill climb. It's time to play the music. It's time to light the lights. It's time to meet the Muppets on the Muppet Show tonight. It's time to put on makeup. It's time to dress up right. It's time to raise the curtain on the Muppet Show tonight. Here's the story of a lovely lady who was bringing up three very lovely girls. Baby if you've ever wondered - wondered whatever became of me. I'm living on the air in Cincinnati. Cincinnati WKRP.", "These days are all Happy and Free. These days are all share them with me oh baby. The ship set ground on the shore of this uncharted desert isle with Gilligan the Skipper too the millionaire and his wife. Believe it or not I'm walking on air. I never thought I could feel so free. Flying away on a wing and a prayer. Who could it be? Believe it or not its just me. Their house is a museum where people come to see ‘em. They really are a scream the Addams Family. And if you threw a party - invited everyone you knew. You would see the biggest gift would be from me and the card attached would say thank you for being a friend?\" Goodbye gray sky hello blue. There's nothing can hold me when I hold you. Feels so right it cant be wrong. Rockin' and rollin' all week long.");
     $users = User::get();
     // Loop through our users
     foreach ($users as $user) {
         // Loop through things to be rated
         foreach ($toComment as $item) {
             $title = $titles[rand(0, sizeof($titles) - 1)];
             $comment = $comments[rand(0, sizeof($comments) - 1)];
             Comment::create(array('user_id' => $user->id, 'item_id' => $item['item']->id, 'item_type' => $item['type'], 'title' => $title, 'content' => $comment));
         }
     }
 }
 public function run()
 {
     DB::table('companions')->delete();
     DB::table('companion_doctor')->delete();
     // Pull up the doctors to attach to companions
     $doctorNine = Doctor::where('number', 9)->first();
     $doctorTen = Doctor::where('number', 10)->first();
     $doctorEleven = Doctor::where('number', 11)->first();
     $doctorTwelve = Doctor::where('number', 12)->first();
     Companion::create(array('name' => 'Amy Pond', 'description' => 'Seven-year old Amelia Pond is visited one night by a mad man in box who eats fish fingers and custard, and who examines the frightening crack in her wall. She waits for him to return. For twelve years. When the “raggedy man” came back, Amy embarked on series of adventures with him, on the eve of her wedding to Rory Williams. The couple later travelled together, got married – an event the Doctor attended only after Amy remembered him back into existence – and had a daughter, Melody. In Amy’s own words, she went to sea and fought pirates, fell in love with a man who waited 2000 years to keep her safe, gave hope to Vincent van Gogh, and saved a whale in outer space. Touched by a Weeping Angel, Amy was catapulted back to 1938, where she lived a happy life with Rory and adopted a son.', 'image' => 'http://thedoctor.coderfaire/assets/img/companions/amy-pond.png'))->doctors()->attach([$doctorEleven->id]);
     Companion::create(array('name' => 'Captain Jack', 'description' => 'Time Agent. Torchwood Leader. Poster Boy for the Boeshane Peninsula. Over his (very) long life, Captain Jack Harkness has been many things. First meeting the Doctor and Rose in 1940s London, he helped defeat the reanimated “Empty Child” and the Slitheen, before being exterminated by the Daleks on the Game Station. Revived and made immortal by Rose Tyler after she’d absorbed the power of the Time Vortex, Jack travelled back to 1869, where his vortex manipulator burned out. Forced to live through the twentieth century, he joined Torchwood in Cardiff, knowing the Doctor would return one day to refuel on the rift. Following the TARDIS to the end of universe, Jack faced the Master, and then Davros and his Dalek crucible, as well as battling many evils on Earth with Torchwood.', 'image' => 'http://thedoctor.coderfaire/assets/img/companions/captain-jack.png'))->doctors()->attach([$doctorNine->id, $doctorTen->id]);
     Companion::create(array('name' => 'Clara Oswald', 'description' => 'That impossible girl. In Victorian London, there’s “sweet little Clara” from the Rose & Crown, who’s also an upright children’s governess. In the far-flung future, Oswin Oswald, the shipwrecked Junior Entertainments Manager from Starship Alaska, in reality a human-Dalek conversion refusing to accept her fate. Identical women, worlds and times apart, impossibly giving the Doctor the same message.', 'image' => 'http://thedoctor.coderfaire/assets/img/companions/clara-oswald.png'))->doctors()->attach([$doctorEleven->id, $doctorTwelve->id]);
     Companion::create(array('name' => 'Donna Noble', 'description' => 'A temp from West London, Donna found herself transported aboard the TARDIS as she was walking down the aisle on her wedding day. Fortunately, the Doctor saved her from marrying Lance – who’d made a deal with the Empress of the Racnoss. Despite turning down the Doctor’s offer to travel with him, she began investigating possible alien incursions, in the hope she’d meet him again. When they were reunited at Adipose Industries, she took up the offer to travel in the TARDIS - visiting Pompeii, meeting Agatha Christie and helping thwart the Sontarans. When the Doctor was exterminated by a Dalek and began regenerating he funneled the energy into his spare hand. When Donna touched this, it provoked a ‘metacrisis’, where she acquired all of the Doctor’s knowledge. Although this was essential in stopping Davros, it started to destroy Donna’s body. The Doctor was forced to wipe her mind and return her to Sylvia and Wilf. He later bought Donna and new husband Shaun a winning lottery ticket.', 'image' => 'http://thedoctor.coderfaire/assets/img/companions/donna-noble.png'))->doctors()->attach([$doctorTen->id]);
     Companion::create(array('name' => 'Martha Jones', 'description' => 'Studying for her doctorate in medicine, Martha Jones was inside Royal Hope Hospital when it was transported to the moon. Showing great bravery in the face of the Plasmavore, the Doctor invited her for travel with him. She was wooed by William Shakespeare, fought Daleks in New York and looked after the Doctor when disguised as a human school teacher in 1913. When the Doctor was captured by the Master, Martha travelled the world telling his story of resistance. The psychic energy this gathered helped release the Time Lord. After activating Project Indigo in the face of Davros\' Reality Bomb, Martha married Mickey Smith and together they hunted alien threats to Earth.', 'image' => 'http://thedoctor.coderfaire/assets/img/companions/martha-jones.png'))->doctors()->attach([$doctorTen->id]);
     Companion::create(array('name' => 'Mickey Smith', 'description' => 'On-off boyfriend of Rose Tyler, Mickey Smith was drawn into the Doctor’s world when he was captured and replicated by the Nestene Consciousness. When Rose vanished for a year with the Doctor, Mickey was questioned over her disappearance. Despite this, and getting called “Mickey the Idiot”, he helped the Doctor and Rose defeat the Slitheen, Sycorax and Krillitanes. He opted to remain in the parallel “Pete’s World” when he discovered that the parallel version of the Grandmother who raised him was a still alive. From there, he assisted Pete and Jake rid their world of Cybermen, before jumping realities and fighting the Battle of Canary Wharf. After a period of living in that world with the Tylers, he returned to his originalEarth, where he married Martha Jones.', 'image' => 'http://thedoctor.coderfaire/assets/img/companions/mickey-smith.png'))->doctors()->attach([$doctorNine->id, $doctorTen->id]);
     Companion::create(array('name' => 'River Song', 'description' => 'Born Melody Pond, to Amy Pond and Rory Williams during the Battle of Demon\'s Run, she was kidnapped by agents of The Silence and raised as the Doctor\'s perfect assassin. But in her pursuit of the Doctor, she fell in love with him, which broke her conditioning. Becoming a Doctor of Archaeology, she was again recruited by The Silence to kill the Doctor at a fixed point in time. However, the assassination was staged to allow the Doctor to disappear from view. Handed 12,000 life sentences for his murder, River spent her days at Stormcage Containment Facility, but her nights travelling with the Doctor. They investigated the wreck of the Byzantium, battled Weeping Angels in New York and visited the Singing Towers of Darillium. She died in The Library, saving the people trapped in its computer. The Doctor was able to upload her into the mainframe where her data ghost “lives” with three children to look after. (The Doctor and River have met each other, broadly speaking, in reverse order - the first time the Doctor meets River is the last time she sees him.)', 'image' => 'http://thedoctor.coderfaire/assets/img/companions/river-song.png'))->doctors()->attach([$doctorTen->id, $doctorEleven->id]);
     Companion::create(array('name' => 'Rory Williams', 'description' => 'In love with Amy Pond from his teens, Rory Williams became a nurse to try and compete with (what he thought was) her made-up friend, the Doctor. When the Doctor turned out to be real, there was initially some friction, but the two became good friends. Rory had a turbulent time in the TARDIS. He was killed by the Silurians and absorbed into a crack in time, before being resurrected as an Auton, who then killed Amy. After breaking his programming, he stood watch over her tomb in the Pandorica for 2000 years. When reality was restored, Rory ceased to be an Auton and returned to human form. While aboard the TARDIS, he and Amy became parents to Melody. Sent back in time to 1938 by a Weeping Angel, Rory lived a happy life with Amy. Their adopted son, Anthony Brian Williams, visited Rory’s father Brian in 2012, bringing a heart-breaking goodbye note from Rory.', 'image' => 'http://thedoctor.coderfaire/assets/img/companions/rory-williams.png'))->doctors()->attach([$doctorEleven->id]);
     Companion::create(array('name' => 'Rose Tyler', 'description' => 'Trapped by Autons in the basement of Henrik\'s department store, shop assistant Rose Tyler’s life is saved by a chance encounter with the Doctor. When her heroism leads to the defeat of the Nestene, he invites her to travel with him – taking her from Victorian Cardiff to the day the Earth died. And although travelling with the Doctor was often dangerous, she told him she’d stay with him forever. Witnessing the Ninth Doctor’s regeneration only made that bond stronger. However, during the Battle of Canary Wharf they were separated – trapped on parallel worlds. Using a Dimension Cannon she attempted to make contact with the Doctor (and new companion Donna) several times, eventually encountering him as he was exterminated by a Dalek. Once healed and the Daleks defeated, he returned Rose to the parallel world with her family and the half-human version of himself, to live the rest of their lives together.', 'image' => 'http://thedoctor.coderfaire/assets/img/companions/rose-tyler.png'))->doctors()->attach([$doctorNine->id, $doctorTen->id]);
     Companion::create(array('name' => 'Wilfred Mott', 'description' => 'Wilf first encountered the Doctor on Christmas Day 2007, when the Time Lord beamed down from the Titanic with Astrid Peth. A year later, during the Adipose affair, he was to see the Doctor again – this time through his telescope as the TARDIS, with Donna aboard, sped across the sky. A keen astronomer, Wilf readily accepted the Doctor\'s alien nature, along with his granddaughter\\’s travelling in time and space. When Donna\'s mind had to be wiped of her travels with the Doctor, he was heartbroken but promised to keep watching the skies for the TARDIS. Extraordinarily loyal, he urged the Doctor to kill the Master and save the world when he opened the timelock on the Time War. It was Wilf who would eventually knock four times, and herald theTenth Doctor’s regeneration.', 'image' => 'http://thedoctor.coderfaire/assets/img/companions/wilfred-mott.png'))->doctors()->attach([$doctorTen->id]);
 }
 public function getAgendas()
 {
     if (Payment::VeryPayment() == false) {
         return View::make('clinic.payment.renews-payment');
     }
     $user = Sentry::getUser();
     $clinic = Clinic::where('user_id', $user->id)->first();
     $doctors = Doctor::where('clinic_id', $clinic->id)->get();
     return View::make('clinic.Agendas.agenda', ['doctors' => $doctors]);
 }
 public function edit($id)
 {
     if (Payment::VeryPayment() == false) {
         return View::make('clinic.payment.renews-payment');
     }
     $user = Sentry::getUser();
     $clinic = Clinic::where('user_id', $user->id)->first();
     $doctor = Doctor::where('clinic_id', $clinic->id)->where('id', $id)->first();
     $agenda = Agenda::where('doctor_id', $doctor->id)->first();
     $esps = explode(',', $doctor->specialty_id);
     $espok = '';
     $array = array();
     foreach ($esps as $esp) {
         $very = Specialty::where('id', $esp)->first();
         if ($very) {
             $array[] = array('value' => $very->id, 'text' => $very->name_es);
         }
     }
     $profile = Profile::where('user_id', $doctor->user_id)->first();
     return View::make('clinic.doctors.edit', ['agenda' => $agenda, 'doctor' => $doctor, 'profile' => $profile, 'specialty' => $array]);
 }
示例#14
0
 public function run()
 {
     DB::table('episodes')->delete();
     DB::table('doctor_episode')->delete();
     DB::table('companion_episode')->delete();
     DB::table('enemy_episode')->delete();
     // Pull up doctors, companions, and enemies to attach to episodes
     $doctorNine = Doctor::where('number', 9)->first();
     $doctorTen = Doctor::where('number', 10)->first();
     $doctorEleven = Doctor::where('number', 11)->first();
     $doctorTwelve = Doctor::where('number', 12)->first();
     $cybermen = Enemy::where('name', 'Cybermen')->first();
     $daleks = Enemy::where('name', 'Daleks')->first();
     $sontarans = Enemy::where('name', 'Sontarans')->first();
     $silence = Enemy::where('name', 'The Silence')->first();
     $angels = Enemy::where('name', 'Weeping Angels')->first();
     $amy = Companion::where('name', 'Amy Pond')->first();
     $jack = Companion::where('name', 'Captain Jack')->first();
     $clara = Companion::where('name', 'Clara Oswald')->first();
     $donna = Companion::where('name', 'Donna Noble')->first();
     $martha = Companion::where('name', 'Martha Jones')->first();
     $mickey = Companion::where('name', 'Mickey Smith')->first();
     $river = Companion::where('name', 'River Song')->first();
     $rory = Companion::where('name', 'Rory Williams')->first();
     $rose = Companion::where('name', 'Rose Tyler')->first();
     $wilfred = Companion::where('name', 'Wilfred Mott')->first();
     $episode = Episode::create(array('season' => 1, 'episode' => 1, 'name' => 'Rose', 'image' => 'http://thedoctor.coderfaire/assets/img/episodes/1.1.jpg', 'description' => 'Rose Tyler believes she is living another day of her "ordinary" life, but after being threatened by Autons (living plastic) controlled by the Nestene Consciousness, she meets the Ninth Doctor.'));
     $episode->doctors()->attach([$doctorNine->id]);
     $episode->companions()->attach([$rose->id, $mickey->id]);
     $episode = Episode::create(array('season' => 1, 'episode' => 6, 'name' => 'Dalek', 'image' => 'http://thedoctor.coderfaire/assets/img/episodes/1.6.jpg', 'description' => 'The Ninth Doctor and Rose Tyler arrive in 2012 to answer a distress signal and meet a collector of alien artefacts who has one living specimen. However, the Doctor is horrified to find out that the creature is a member of a race he thought was destroyed: a Dalek.'));
     $episode->doctors()->attach([$doctorNine->id]);
     $episode->companions()->attach([$rose->id]);
     $episode->enemies()->attach([$daleks->id]);
     $episode = Episode::create(array('season' => 1, 'episode' => 10, 'name' => 'The Doctor Dances', 'image' => 'http://thedoctor.coderfaire/assets/img/episodes/1.10.jpg', 'description' => 'The Child\'s plague is spreading throughout wartime London, and its zombie army is on the march. The Ninth Doctor and Rose form an alliance with intergalactic con man Captain Jack, but find themselves trapped in the abandoned hospital. They head to the crash site of Jack\'s supposed space junk and discover the ground zero for the mysterious plague.'));
     $episode->doctors()->attach([$doctorNine->id]);
     $episode->companions()->attach([$rose->id, $jack->id]);
     $episode = Episode::create(array('season' => 1, 'episode' => 12, 'name' => 'Bad Wolf', 'image' => 'http://thedoctor.coderfaire/assets/img/episodes/1.12.jpg', 'description' => 'Separated and with no TARDIS, the Ninth Doctor, Rose, and Jack have to fight for their lives on board the Game Station, but a far more dangerous threat is lurking, just out of sight. The Doctor realises that the entire human race has been blinded to the threat on its doorstep, and Armageddon is fast approaching.'));
     $episode->doctors()->attach([$doctorNine->id]);
     $episode->companions()->attach([$rose->id, $mickey->id, $jack->id]);
     $episode->enemies()->attach([$daleks->id]);
     $episode = Episode::create(array('season' => 2, 'episode' => 5, 'name' => 'Rise of the Cybermen', 'image' => 'http://thedoctor.coderfaire/assets/img/episodes/2.5.jpg', 'description' => 'On a parallel Earth, a deadly new version of the Doctor\'s old enemy is about to be reborn.'));
     $episode->doctors()->attach([$doctorTen->id]);
     $episode->companions()->attach([$rose->id, $mickey->id]);
     $episode->enemies()->attach([$cybermen->id]);
     $episode = Episode::create(array('season' => 2, 'episode' => 12, 'name' => 'Army of Ghosts', 'image' => 'http://thedoctor.coderfaire/assets/img/episodes/2.12.jpg', 'description' => 'Rose and the Tenth Doctor return to modern-day London to find a mysterious epidemic of ghosts all over the world. As the Doctor searches Torchwood Tower to find answers, something sinister lurks in the building.'));
     $episode->doctors()->attach([$doctorTen->id]);
     $episode->companions()->attach([$rose->id, $mickey->id]);
     $episode->enemies()->attach([$daleks->id, $cybermen->id]);
     $episode = Episode::create(array('season' => 3, 'episode' => 9, 'name' => 'The Family of Blood', 'image' => 'http://thedoctor.coderfaire/assets/img/episodes/3.9.jpg', 'description' => '1913, and war comes to England a year early as the terrifying Family hunt for the Tenth Doctor.'));
     $episode->doctors()->attach([$doctorTen->id]);
     $episode->companions()->attach([$martha->id]);
     $episode = Episode::create(array('season' => 3, 'episode' => 10, 'name' => 'Blink', 'image' => 'http://thedoctor.coderfaire/assets/img/episodes/3.10.jpg', 'description' => 'In an abandoned house, the Weeping Angels wait. The only hope to stop them is a young woman named Sally Sparrow and her friend Larry Nightingale. The only catch: The Weeping Angels can move in the blink of an eye. To defeat the ruthless enemy — with only a half of a conversation from the Tenth Doctor as help — the one rule is this: don\'t turn your back, don\'t look away and don\'t blink!'));
     $episode->doctors()->attach([$doctorTen->id]);
     $episode->companions()->attach([$martha->id]);
     $episode->enemies()->attach([$angels->id]);
     $episode = Episode::create(array('season' => 4, 'episode' => 4, 'name' => 'The Sontaran Stratagem', 'image' => 'http://thedoctor.coderfaire/assets/img/episodes/4.4.png', 'description' => 'Fifty-two people across the world in eleven different time zones die at the exact same time. The only connection: they all have ATMOS installed in their vehicles. Martha Jones, now a UNIT medic, summons the Tenth Doctor back to modern-day Earth to help figure out why, but an old enemy lies in wait...'));
     $episode->doctors()->attach([$doctorTen->id]);
     $episode->companions()->attach([$martha->id, $donna->id]);
     $episode->enemies()->attach([$sontarans->id]);
     $episode = Episode::create(array('season' => 4, 'episode' => 13, 'name' => 'Journey\'s End', 'image' => 'http://thedoctor.coderfaire/assets/img/episodes/4.13.jpg', 'description' => 'All hell has broken loose! Davros and the New Dalek Empire prepare to detonate a bomb that will wipe out all of existence. The Tenth Doctor is helpless, and the TARDIS faces destruction. The only hope lies with the Doctor\'s companions — the "Children of Time" — but Dalek Caan predicts that one will die...'));
     $episode->doctors()->attach([$doctorTen->id]);
     $episode->companions()->attach([$rose->id, $donna->id, $martha->id, $jack->id, $mickey->id, $wilfred->id]);
     $episode->enemies()->attach([$daleks->id]);
     $episode = Episode::create(array('season' => 5, 'episode' => 3, 'name' => 'Victory of the Daleks', 'image' => 'http://thedoctor.coderfaire/assets/img/episodes/5.3.jpg', 'description' => 'Receiving a call for help from his old friend Winston Churchill, the Eleventh Doctor and Amy Pond head for World War II to assist the Prime Minister. Once there, though, the Doctor reunites with his greatest enemies, the scum of the universe — the Daleks. But why are these survivors of the Medusa Cascade War passing themselves off as man-made weapons? And why don\'t they recognise the Doctor? What could these "Ironsides" have planned?'));
     $episode->doctors()->attach([$doctorEleven->id]);
     $episode->companions()->attach([$amy->id]);
     $episode->enemies()->attach([$daleks->id]);
     $episode = Episode::create(array('season' => 5, 'episode' => 4, 'name' => 'The Time of Angels', 'image' => 'http://thedoctor.coderfaire/assets/img/episodes/5.4.jpg', 'description' => 'The enigmatic River Song hurtles back into the Eleventh Doctor\'s life, but she\'s not the only familiar face returning — the Weeping Angels are back! Following River\'s calling card, the Doctor is recruited to help track down the last of the Angels, which has escaped from the Byzantium starliner and into the terrifying Maze of the Dead.'));
     $episode->doctors()->attach([$doctorEleven->id]);
     $episode->companions()->attach([$amy->id, $river->id]);
     $episode->enemies()->attach([$angels->id]);
     $episode = Episode::create(array('season' => 5, 'episode' => 12, 'name' => 'The Pandorica Opens', 'image' => 'http://thedoctor.coderfaire/assets/img/episodes/5.12.jpg', 'description' => 'A Van Gogh painting ferried across thousands of years offering a terrifying prophecy, a message on the oldest cliff-face in the universe and a love that lasts a thousand years: in 102 AD England, Romans receive a surprise visit from Cleopatra. Nearby, Stonehenge hides a legendary prison-box. As it slowly unlocks from the inside, terrible forces gather in the heavens. The fates are closing around the TARDIS. The Pandorica, which contains the most dangerous threat in the Universe, is opening. Only one thing is certain: "The Pandorica will open... Silence will fall".'));
     $episode->doctors()->attach([$doctorEleven->id]);
     $episode->companions()->attach([$amy->id, $rory->id, $river->id]);
     $episode->enemies()->attach([$silence->id]);
     $episode = Episode::create(array('season' => 6, 'episode' => 1, 'name' => 'The Impossible Astronaut', 'image' => 'http://thedoctor.coderfaire/assets/img/episodes/6.1.jpg', 'description' => 'Amy Pond, Rory Williams, River Song and the Eleventh Doctor receive a mysterious summons that takes them on an adventure to 21st century Utah and Florida in 1969. Along the way they meet Richard Nixon, president of the United States of America, and former FBI agent Canton Delaware.'));
     $episode->doctors()->attach([$doctorEleven->id]);
     $episode->companions()->attach([$amy->id, $rory->id, $river->id]);
     $episode->enemies()->attach([$silence->id]);
     $episode = Episode::create(array('season' => 6, 'episode' => 10, 'name' => 'The Girl Who Waited', 'image' => 'http://thedoctor.coderfaire/assets/img/episodes/6.10.jpg', 'description' => 'The Eleventh Doctor, Rory Williams and Amy Pond land on Apalapucia in the middle of a plague. Amy is left behind, and the Doctor and Rory must save her...but time for Amy is running at a different speed.'));
     $episode->doctors()->attach([$doctorEleven->id]);
     $episode->companions()->attach([$amy->id, $rory->id]);
     $episode = Episode::create(array('season' => 6, 'episode' => 13, 'name' => 'The Wedding of River Song', 'image' => 'http://thedoctor.coderfaire/assets/img/episodes/6.13.jpg', 'description' => 'The Eleventh Doctor is prepared to meet his death at Lake Silencio. However, all of history is happening at once. What is happening and who is responsible?'));
     $episode->doctors()->attach([$doctorEleven->id]);
     $episode->companions()->attach([$amy->id, $rory->id, $river->id]);
     $episode->enemies()->attach([$silence->id]);
     $episode = Episode::create(array('season' => 7, 'episode' => 5, 'name' => 'The Angels Take Manhattan', 'image' => 'http://thedoctor.coderfaire/assets/img/episodes/7.5.jpg', 'description' => 'A simple trip to 2012 New York goes horribly wrong when the Eleventh Doctor\'s companion, Rory Williams, is sent back to the 1930s by the Weeping Angels. There, he finds that his daughter, River Song, is investigating the Angels, as Manhattan has become their hunting grounds. The Doctor and Amy Pond must find Rory before it is too late, but they soon find that not every point in time can be changed. And here, the Doctor must face the one thing he has been dreading — a final farewell to the Ponds.'));
     $episode->doctors()->attach([$doctorEleven->id]);
     $episode->companions()->attach([$amy->id, $rory->id, $river->id]);
     $episode->enemies()->attach([$angels->id]);
     $episode = Episode::create(array('season' => 7, 'episode' => 12, 'name' => 'Nightmare in Silver', 'image' => 'http://thedoctor.coderfaire/assets/img/episodes/7.12.jpg', 'description' => 'The Eleventh Doctor takes his companion, Clara Oswald, and her wards, Angie and Artie, to the biggest amusement park, Hedgewick\'s World of Wonders. The theme park is empty, occupied by a "punishment platoon" and a lone impresario with empty Cyberman shells as exhibits. The Doctor decides to stay a while, however, to investigate strange insect creatures that are roaming the park. But these insects are really machines seeking to convert the life forms on Hedgewick\'s World into the newest generation of the ever-upgrading menace...'));
     $episode->doctors()->attach([$doctorEleven->id]);
     $episode->companions()->attach([$clara->id]);
     $episode->enemies()->attach([$cybermen->id]);
     $episode = Episode::create(array('season' => 8, 'episode' => 2, 'name' => 'Into the Dalek', 'image' => 'http://thedoctor.coderfaire/assets/img/episodes/8.2.jpg', 'description' => 'Surrounded by his greatest enemies, the newest Doctor will journey into the most dangerous place in all of the universe. With the limits of his compassion being tested, the Doctor will be forced to ask a question about himself that he doesn\'t know: "Am I a good man?"'));
     $episode->doctors()->attach([$doctorTwelve->id]);
     $episode->companions()->attach([$clara->id]);
     $episode->enemies()->attach([$daleks->id]);
 }
 public function getConfigSave()
 {
     if (Payment::VeryPayment() == false) {
         return View::make('clinic.payment.renews-payment');
     }
     $data = array("insurance" => Input::get("insurance"), "lang" => Input::get("lang"));
     $rules = array("insurance" => 'required|min:1|max:100', "lang" => 'required|min:1|max:100');
     $messages = array('required' => 'El campo :attribute es obligatorio.', 'min' => 'El campo :attribute no puede tener menos de :min carácteres.', 'email' => 'El campo :attribute debe ser un email válido.', 'max' => 'El campo :attribute no puede tener más de :max carácteres.', 'numeric' => 'El campo :attribute debe contener solo numeros', 'mimes' => 'El formato de la imagen logo debe ser jpg, git, png');
     $validation = Validator::make(Input::all(), $rules, $messages);
     //si la validación falla redirigimos al formulario de registro con los errores
     //y con los campos que nos habia llenado el usuario
     if ($validation->fails()) {
         return Redirect::to('/clinic/config-data/')->withErrors($validation)->withInput();
     } else {
         $id = Doctor::doctorLogin();
         $doctor = Doctor::where('id', $id)->first();
         $lang = Option::where('name', $id . '-doctor-lang')->first();
         if ($lang) {
             $lang->key = Input::get("lang");
             $lang->save();
         } else {
             $langadd = new Option();
             $langadd->key = Input::get("lang");
             $langadd->name = $id . '-doctor-lang';
             $langadd->save();
         }
         $opcionSeg = Option::where('name', $id . '-doctor-insurance')->first();
         if ($opcionSeg) {
             $segs = explode(',', Input::get("insurance"));
             $segok = '';
             foreach ($segs as $seg) {
                 $very = Insurance::where('name', 'like', '%' . $seg . '%')->first();
                 if ($very) {
                     $segok = $segok . ',' . $seg;
                 }
             }
             $opcionSeg->key = $segok;
             $opcionSeg->save();
         } else {
             $segs = explode(',', Input::get("insurance"));
             $seguok = '';
             foreach ($segs as $seg) {
                 $very = Insurance::where('name', $seg)->first();
                 if ($very) {
                     $seguok = $seguok . ',' . $seg;
                 }
             }
             $addseg = new Option();
             $addseg->name = $id . '-doctor-insurance';
             $addseg->key = $seguok;
             $addseg->save();
         }
         return Redirect::back();
     }
 }