当前位置: 首页>>代码示例>>PHP>>正文


PHP App::save方法代码示例

本文整理汇总了PHP中app\App::save方法的典型用法代码示例。如果您正苦于以下问题:PHP App::save方法的具体用法?PHP App::save怎么用?PHP App::save使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\App的用法示例。


在下文中一共展示了App::save方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: store

 public function store(Request $request)
 {
     $app = new App();
     $app->name = Input::get('name');
     $app->category_id = Category::where('name', '=', Input::get('class_name'))->pluck('id');
     $app->slogan = Input::get('slogan');
     $app->introduce = Input::get('introduce');
     $app->android = Input::get('android');
     $app->ios = Input::get('ios');
     $app->download = Input::get('download');
     $app->is_check = 0;
     //图片处理
     $tmp_name = $_FILES['logo']['tmp_name'];
     if ($tmp_name) {
         $result_pic = $data['logo'] = FileHandler::uploadPic($tmp_name);
         if ($result_pic['success']) {
             $app->logo = $result_pic['name'];
         } else {
             return Redirect::back()->withInput()->withErrors($result_pic['msg']);
         }
     }
     if ($app->save()) {
         return Redirect::back();
     } else {
         return Redirect::back()->withInput()->withErrors('保存失败!');
     }
 }
开发者ID:kevinwan,项目名称:che123,代码行数:27,代码来源:AppController.php

示例2: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $access_token = generate_access_token();
     $email = 'a1t1-' . generate_email() . '@telegramlogin.com';
     $user = new User();
     $user->name = 'david pichsenmeister';
     $user->username = 'pichsenmeister';
     $user->email = $email;
     $user->telegram_id = 41478911;
     $user->access_token = $access_token;
     $user->save();
     $app = new App();
     $app->user_id = $user->id;
     $app->name = 'Telegram Login';
     $app->client_id = 314159265;
     $app->client_secret = generate_client_secret();
     $app->website = env('URL');
     $app->redirect_url = env('URL') . '/login';
     $app->save();
     $tg = new TelegramUser();
     $tg->telegram_id = 41478911;
     $tg->name = 'david pichsenmeister';
     $tg->username = 'pichsenmeister';
     $tg->save();
     $auth = new Auth();
     $auth->app_id = $app->id;
     $auth->telegram_user_id = $tg->id;
     $auth->email = $email;
     $auth->access_token = $access_token;
     $auth->save();
 }
开发者ID:3x14159265,项目名称:telegramlogin,代码行数:36,代码来源:UserTableSeeder.php

示例3: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Requests\AppRequest $request)
 {
     $app = new App();
     $app->fill($request->all());
     $app->user_id = $request->user()->id;
     $app->client_id = generate_client_id();
     $app->client_secret = generate_client_secret();
     $app->save();
     return redirect('dashboard');
 }
开发者ID:3x14159265,项目名称:telegramlogin,代码行数:16,代码来源:AppController.php


注:本文中的app\App::save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。