Exemplo n.º 1
0
 public function update($id)
 {
     // save updated
     $record = $this->records->find($id);
     if (!$record) {
         Corporation::create(Input::all());
         return $this->respond($record);
     }
     $record->fill(Input::all())->save();
     return $this->respond($record);
 }
Exemplo n.º 2
0
 public function adminQuestionPreview(User $user, Skill $skill, Corporation $corporation)
 {
     $answers = $corporation->answers()->get();
     return view('admin.skill.corporation.question.index', compact('user', 'answers', 'corporation', 'skill'))->with(['title' => 'Question Preview']);
 }
Exemplo n.º 3
0
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     parent::boot($router);
     //        $router->model('user' , 'App\User');
     $router->bind('user', function ($value) {
         return User::with('roles')->findOrFail($value);
     });
     /**
      * created by dara on 6/9/2015
      * add binding for admin wild card
      */
     $router->bind('admin', function ($value) {
         return User::with('roles')->findOrFail($value);
     });
     /**
      * Created by Emad Mirzaie on 09/09/2015.
      * province wild cart
      */
     $router->model('province', 'App\\Province');
     $router->model('city', 'App\\Province');
     $router->model('university', 'App\\University');
     $router->model('article', 'App\\Article');
     $router->model('post', 'App\\Post');
     $router->model('category', 'App\\Category');
     $router->model('sub_category', 'App\\Category');
     $router->model('skill', 'App\\Skill');
     $router->model('profile', 'App\\User');
     $router->model('comment', 'App\\Comment');
     $router->model('poll', 'App\\Poll');
     $router->model('questionnaire', 'App\\Questionnaire');
     $router->model('coupon_user', 'App\\CouponUser');
     $router->model('showcase', 'App\\Showcase');
     $router->model('sticky', 'App\\Sticky');
     /**
      * Created By Dara on 22/10/2015
      */
     //        $router->bind('offer',function($value){
     //            return Offer::findOrFail($value);
     //        });
     $router->bind('service', function ($value) {
         return CouponGallery::findOrFail($value);
     });
     $router->bind('coupon', function ($value) {
         return Coupon::findOrFail($value);
     });
     $router->bind('group', function ($value) {
         return Group::findOrFail($value);
     });
     $router->bind('problem', function ($value) {
         return Problem::findOrFail($value);
     });
     $router->model('offer', 'App\\Offer');
     $router->model('shop', 'App\\Shop');
     $router->model('product', 'App\\Product');
     $router->bind('event', function ($value) {
         return Event::findOrFail($value);
     });
     $router->bind('settle', function ($value) {
         return Settle::findOrFail($value);
     });
     $router->bind('report', function ($value) {
         return Report::findOrFail($value);
     });
     $router->bind('corporation', function ($value) {
         return Corporation::findOrFail($value);
     });
     /**
      * Created By Dara on 25/12/2015
      */
     $router->bind('announcement', function ($value) {
         return Announcement::findOrFail($value);
     });
     $router->bind('storage', function ($value) {
         return Storage::findOrFail($value);
     });
     $router->bind('role', function ($value) {
         return Role::findOrFail($value);
     });
 }
Exemplo n.º 4
0
 public function run()
 {
     DB::table('corporations')->delete();
     Corporation::create(['applicant_id' => 4, 'corporation' => 'SHIELD', 'ssn' => '929293393', 'address' => 'Communications Department', 'city' => 'Sky Carrier', 'state_id' => 4, 'zip' => '77631', 'email' => '*****@*****.**', 'phone' => '5125555050', 'description' => 'S.H.I.E.L.D. is an espionage and law-enforcement agency in the Marvel Comics Universe. Created by Stan Lee and Jack Kirby in Strange Tales #135 (Aug. 1965), it often deals with paranormal and superhuman threats. The acronym originally stood for Supreme Headquarters, International Espionage, Law-Enforcement Division. It was changed in 1991 to Strategic Hazard Intervention Espionage Logistics Directorate.', 'president' => 'Fury, Nick S.', 'vicepresident' => 'Coulson, Phil', 'secretary' => 'Hill, Maria', 'treasurer' => 'Sitwell, Jasper']);
 }