Created
May 26, 2019 07:54
-
-
Save hashihei/3167137957e1eab88e0f8ceccefb4c6e to your computer and use it in GitHub Desktop.
[myfirstcontroller]Model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\models; | |
use Illuminate\Database\Eloquent\Model; | |
use Illuminate\Support\Facades\DB; | |
class mysqlModel extends Model | |
{ | |
//getMariaDBUserlist | |
public function getUsers() | |
{ | |
$data = DB::table('user')->pluck('user'); | |
return $data->all(); | |
} | |
//getMariaDBHostlist | |
public function getHost() | |
{ | |
$data = DB::table('user')->pluck('host'); | |
return $data->all(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment