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


PHP Admin::all方法代码示例

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


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

示例1: index

 /**
  * Display a listing of admins
  *
  * @return Response
  */
 public function index()
 {
     // $admins = DB::table('admins')->get();
     // $admins =
     // [
     //     'admins' => $admins
     // ];
     // return View::make('admins.index', $admins)->withTitle('Admin');
     $admins = Admin::all();
     return View::make('admins.index', compact('admins'))->withTitle('Admin');
 }
开发者ID:inseo201,项目名称:atletik4,代码行数:16,代码来源:AdminsController.php

示例2: login

 public function login()
 {
     if (Input::exists("email") || Input::exists("password") || Input::exists("key")) {
         $key = Input::get("key");
         if (!empty($key) && $key == $_SESSION['key']) {
             $email = Input::get("email");
             $pass = Input::get("password");
             if (empty($email) || empty($pass)) {
                 textMsg("Unable to login as administrator", "error");
                 Redirect::url("home");
                 exit;
             } else {
                 $admin = Admin::all(['email' => $email]);
                 if (count($admin) > 0) {
                     if (Pass::verify($admin[0]->password, $pass)) {
                         $_SESSION['adminId'] = $admin[0]->id;
                         $_SESSION['adminEmail'] = $admin[0]->email;
                         textMsg("You have logged in", "success");
                         Redirect::url("administrator/dashboard");
                         exit;
                     } else {
                         textMsg("Password id did not match", "error");
                         Redirect::url("administrator");
                         exit;
                     }
                 } else {
                     textMsg("Email id did not match", "error");
                     Redirect::url("administrator");
                     exit;
                 }
             }
         } else {
             textMsg("Unable to login as administrator", "error");
             Redirect::url("home");
             exit;
         }
     } else {
         textMsg("somethis went wrong try again", "error");
         Redirect::url("home");
         exit;
     }
 }
开发者ID:vishalmote,项目名称:roadhunk,代码行数:42,代码来源:administrator.php

示例3: index

 public function index()
 {
     $this->data['administradores'] = Admin::all();
     return View::make('admin/dashboard', $this->data);
 }
开发者ID:rodrigopbel,项目名称:ong,代码行数:5,代码来源:AdminDashboardController.php

示例4: dataTables

 public function dataTables()
 {
     $admins = Admin::all();
     return Datatable::collection($admins)->showColumns("id", "account", "name", "created_at")->searchColumns('account')->orderColumns('created_at')->setAliasMapping()->make();
 }
开发者ID:Kangaroos,项目名称:oneshike,代码行数:5,代码来源:AdminController.php

示例5: add_admin_do

 public function add_admin_do()
 {
     $username = Input::get('username');
     $password = Input::get('password');
     $validator = Validator::make(array('username' => $username, 'password' => $password), array('username' => 'required', 'password' => 'required|min:6'));
     if ($validator->fails()) {
         $error_messages = $validator->messages()->first();
         Session::put('msg', $error_messages);
         $admin = Admin::all();
         return View::make('add_admin')->with('title', 'Add Admin')->with('page', 'add_admin')->with('admin', $admin);
     } else {
         $admin = new Admin();
         $password = Hash::make(Input::get('password'));
         $admin->username = $username;
         $admin->password = $admin->password = $password;
         $admin->save();
         return Redirect::to("/admin/admins?success=1");
     }
 }
开发者ID:felipemarques8,项目名称:goentregas,代码行数:19,代码来源:AdminController.php

示例6: logincheck

<?php

/**
 * Created by Tyfix 2015
 */
include 'config.php';
logincheck();
$message = [];
if (isset($_GET['delete'])) {
    if ($_GET['delete'] == 1) {
        $message['type'] = "error";
        $message['message'] = "You cannot remove the main admin account";
    } else {
        $admin = Admin::find($_GET['delete']);
        $admin->delete();
        $message['type'] = "success";
        $message['message'] = "Admin deleted";
    }
}
$admins = Admin::all();
echo $template->view()->make('admins')->with('admins', $admins)->with('message', $message)->render();
开发者ID:addonBrasil,项目名称:FOS-Streaming-v1,代码行数:21,代码来源:admins.php


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