當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Hash::Make方法代碼示例

本文整理匯總了PHP中Hash::Make方法的典型用法代碼示例。如果您正苦於以下問題:PHP Hash::Make方法的具體用法?PHP Hash::Make怎麽用?PHP Hash::Make使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Hash的用法示例。


在下文中一共展示了Hash::Make方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: postUpdateemp

 public function postUpdateemp()
 {
     $inputs = Input::all();
     $employee = Employee::find($inputs['id']);
     if (is_object($employee)) {
         $photoNewName = $employee->emp_image;
         // upload photo
         if (Input::hasFile('photo')) {
             $photo = Input::file('photo');
             $photoNewName = date('YmdHis') . '.' . $photo->getClientOriginalExtension();
             if (file_exists('image/employee/' . $employee->emp_image)) {
                 File::delete('image/employee/' . $employee->emp_image);
             }
             $photo->move('image/employee', $photoNewName);
         }
         $employee->emp_name = $inputs['fullname'];
         $employee->emp_idcard = $inputs['cardid'];
         $employee->emp_address = $inputs['address'];
         $employee->emp_tel = $inputs['tel'];
         $employee->emp_lineid = $inputs['lineid'];
         $employee->emp_email = $inputs['email'];
         $employee->emp_image = $photoNewName;
         $employee->emp_username = $inputs['username'];
         $employee->emp_password = Hash::Make($inputs['password']);
         $employee->save();
         return Redirect::to('admin/employee/showallemployee')->with('alert', 'แก้ไขข้อมูลเรียบร้อยแล้ว');
     }
 }
開發者ID:kuanblock,項目名稱:posonline,代碼行數:28,代碼來源:EmployeeController.php

示例2: postUpdate

 public function postUpdate()
 {
     $inputs = Input::all();
     $user = User::find($inputs['id']);
     //หา Data ก่อน คำสั่ง find ใช้กับ id
     if (is_object($user)) {
         $user->username = $inputs['username'];
         $user->password = !empty($inputs['password']) ? Hash::Make($inputs['password']) : $user->password;
         $user->fullname = $inputs['fullname'];
         $user->user_group = $inputs['group'];
         $user->save();
         return Redirect::to('admin/user')->with('message', 'Update Completed');
     }
 }
開發者ID:kuanblock,項目名稱:laravelproject,代碼行數:14,代碼來源:UserController.php

示例3: run

 public function run()
 {
     /**
      * Checks if the `comments` table exists.
      * If it exists, delete it.
      */
     if (Schema::hasTable('comments')) {
         $this->command->info('Old table comments detected!');
         Schema::drop('comments');
         $this->command->info('Old table comments deleted!');
         /**
          * If after deletion the table still exists, then I'm fucked.
          */
         if (Schema::hasTable('comments')) {
             $this->command->info('Im fucked');
         }
     }
     /**
      * Checks if the `articles` table exists.
      * If it exists, delete it.
      */
     if (Schema::hasTable('articles')) {
         $this->command->info('Old table articles detected!');
         //            DB::table('articles')->delete();
         Schema::drop('articles');
         $this->command->info('Old table articles deleted!');
         /**
          * If after deletion the table still exists, then I'm fucked.
          */
         if (Schema::hasTable('articles')) {
             $this->command->info('Im fucked');
         }
     }
     /**
      * Checks if the `users` table exists.
      * If it exists, delete it.
      */
     if (Schema::hasTable('users')) {
         $this->command->info('Old table users detected!');
         //            DB::table('articles')->delete();
         Schema::drop('users');
         $this->command->info('Old table users deleted!');
         /**
          * If after deletion the table still exists, then I'm fucked.
          */
         if (Schema::hasTable('users')) {
             $this->command->info('Im fucked');
         }
     }
     /**
      * Recreate the articles table
      */
     Schema::create('users', function ($table) {
         $table->increments('id');
         //            $table->foreign('article_id')->references('id')->on('articles')->onDelete('cascade');
         $table->string('name');
         $table->string('email');
         $table->string('password');
         $table->string('remember_token');
         $table->timestamps();
     });
     $this->command->info('Recreation of users succeeded!');
     /**
      * Recreate the articles table
      */
     Schema::create('articles', function ($table) {
         $table->increments('id');
         $table->integer('user_id')->unsigned();
         $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
         $table->string('title');
         $table->string('content');
         $table->timestamps();
     });
     $this->command->info('Recreation of articles succeeded!');
     /**
      * Recreate the comments table
      */
     Schema::create('comments', function ($table) {
         $table->increments('id');
         $table->integer('article_id')->unsigned();
         $table->foreign('article_id')->references('id')->on('articles')->onDelete('cascade');
         $table->string('content');
         $table->integer('user_id')->unsigned();
         $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
         $table->timestamps();
     });
     $this->command->info('Recreation of comments succeeded!');
     /**
      * Insert columns into the table.
      */
     //        Schema::table('articles', function($table)
     //        {
     //
     //        });
     User::create(['email' => 'foo@bar.com', 'name' => 'Hu Zheng', 'password' => Hash::Make('password')]);
     User::create(['email' => 'foobar@bar.com', 'name' => 'Your Daddy', 'password' => Hash::Make('password')]);
     Article::create(['title' => 'Hi!', 'user_id' => 1, 'content' => 'This is the very first article']);
     Article::create(['title' => 'Hi!', 'user_id' => 2, 'content' => 'This is the very second article']);
     Comment::create(['article_id' => 1, 'content' => 'This is the very first comment', 'user_id' => 1]);
     Comment::create(['article_id' => 1, 'content' => 'This is the very second comment', 'user_id' => 2]);
//.........這裏部分代碼省略.........
開發者ID:Axure,項目名稱:LarCMS,代碼行數:101,代碼來源:DatabaseSeeder.php

示例4: generateHash

 public static function generateHash()
 {
     return Hash::Make(md5(openssl_random_pseudo_bytes(10)));
 }
開發者ID:pali88,項目名稱:nodspot-web,代碼行數:4,代碼來源:UsersController.php


注:本文中的Hash::Make方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。