Routes.php
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/
Route::get('/', function()
{
Auth::attempt(array('email'=>'resul@resulaslan.com','password'=>'12345'));
echo "<pre>";
print_r(Auth::User()->get()->toArray());
echo "</pre>";
//return View::make('hello');
});
Auth.php
<?php
return array(
/*
|--------------------------------------------------------------------------
| Default Authentication Driver
|--------------------------------------------------------------------------
|
| This option controls the authentication driver that will be utilized.
| This driver manages the retrieval and authentication of the users
| attempting to get access to protected areas of your application.
|
| Supported: "database", "eloquent"
|
*/
'driver' => 'eloquent',
/*
|--------------------------------------------------------------------------
| Authentication Model
|--------------------------------------------------------------------------
|
| When using the "Eloquent" authentication driver, we need to know which
| Eloquent model should be used to retrieve your users. Of course, it
| is often just the "User" model but you may use whatever you like.
|
*/
'model' => 'Uye',
/*
|--------------------------------------------------------------------------
| Authentication Table
|--------------------------------------------------------------------------
|
| When using the "Database" authentication driver, we need to know which
| table should be used to retrieve your users. We have chosen a basic
| default value but you may easily change it to any table you like.
|
*/
'table' => 'uyes',
/*
|--------------------------------------------------------------------------
| Password Reminder Settings
|--------------------------------------------------------------------------
|
| Here you may set the settings for password reminders, including a view
| that should be used as your password reminder e-mail. You will also
| be able to set the name of the table that holds the reset tokens.
|
| The "expire" time is the number of minutes that the reminder should be
| considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed.
|
*/
'reminder' => array(
'email' => 'emails.auth.reminder',
'table' => 'password_reminders',
'expire' => 60,
),
);
2014_04_01_054844_uye-olustur.php
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class UyeOlustur extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('uyes', function($t)
{
$t->increments('id');
$t->string('email',64);
$t->string('password',64);
$t->string('isim',64);
$t->boolean('onay');
$t->tinyInteger('puan');
$t->tinyInteger('rol');
$t->integer('sehir_id');
$t->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
Uye.php
<?php
use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemindableInterface;
class Uye extends Eloquent implements UserInterface, RemindableInterface {
protected $table = 'uyes';
protected $hidden = array('password');
public function getAuthIdentifier()
{
return $this->getKey();
}
public function getAuthPassword()
{
return $this->password;
}
public function getReminderEmail()
{
return $this->email;
}
}
Sonuç :
Array
(
[0] => Array
(
[id] => 1
[email] => resul@resulaslan.com
[isim] => Resul
[onay] => 1
[puan] => 2
[rol] => 4
[sehir_id] => 43
[created_at] => 0000-00-00 00:00:00
[updated_at] => 0000-00-00 00:00:00
)
)