@@ -1,33 +0,0 @@ | |||||
<?php | |||||
namespace App\Models; | |||||
use Illuminate\Auth\Authenticatable; | |||||
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract; | |||||
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract; | |||||
use Illuminate\Database\Eloquent\Factories\HasFactory; | |||||
use Illuminate\Database\Eloquent\Model; | |||||
use Laravel\Lumen\Auth\Authorizable; | |||||
class User extends Model implements AuthenticatableContract, AuthorizableContract | |||||
{ | |||||
use Authenticatable, Authorizable, HasFactory; | |||||
/** | |||||
* The attributes that are mass assignable. | |||||
* | |||||
* @var array | |||||
*/ | |||||
protected $fillable = [ | |||||
'name', 'email', | |||||
]; | |||||
/** | |||||
* The attributes excluded from the model's JSON form. | |||||
* | |||||
* @var array | |||||
*/ | |||||
protected $hidden = [ | |||||
'password', | |||||
]; | |||||
} |
@@ -1,18 +0,0 @@ | |||||
<?php | |||||
namespace App\Providers; | |||||
use Illuminate\Support\ServiceProvider; | |||||
class AppServiceProvider extends ServiceProvider | |||||
{ | |||||
/** | |||||
* Register any application services. | |||||
* | |||||
* @return void | |||||
*/ | |||||
public function register() | |||||
{ | |||||
// | |||||
} | |||||
} |
@@ -1,39 +0,0 @@ | |||||
<?php | |||||
namespace App\Providers; | |||||
use App\Models\User; | |||||
use Illuminate\Support\Facades\Gate; | |||||
use Illuminate\Support\ServiceProvider; | |||||
class AuthServiceProvider extends ServiceProvider | |||||
{ | |||||
/** | |||||
* Register any application services. | |||||
* | |||||
* @return void | |||||
*/ | |||||
public function register() | |||||
{ | |||||
// | |||||
} | |||||
/** | |||||
* Boot the authentication services for the application. | |||||
* | |||||
* @return void | |||||
*/ | |||||
public function boot() | |||||
{ | |||||
// Here you may define how you wish users to be authenticated for your Lumen | |||||
// application. The callback which receives the incoming request instance | |||||
// should return either a User instance or null. You're free to obtain | |||||
// the User instance via an API token or any other method necessary. | |||||
$this->app['auth']->viaRequest('api', function ($request) { | |||||
if ($request->input('api_token')) { | |||||
return User::where('api_token', $request->input('api_token'))->first(); | |||||
} | |||||
}); | |||||
} | |||||
} |
@@ -1,19 +0,0 @@ | |||||
<?php | |||||
namespace App\Providers; | |||||
use Laravel\Lumen\Providers\EventServiceProvider as ServiceProvider; | |||||
class EventServiceProvider extends ServiceProvider | |||||
{ | |||||
/** | |||||
* The event listener mappings for the application. | |||||
* | |||||
* @var array | |||||
*/ | |||||
protected $listen = [ | |||||
\App\Events\ExampleEvent::class => [ | |||||
\App\Listeners\ExampleListener::class, | |||||
], | |||||
]; | |||||
} |
@@ -1,29 +0,0 @@ | |||||
<?php | |||||
namespace Database\Factories; | |||||
use App\Models\User; | |||||
use Illuminate\Database\Eloquent\Factories\Factory; | |||||
class UserFactory extends Factory | |||||
{ | |||||
/** | |||||
* The name of the factory's corresponding model. | |||||
* | |||||
* @var string | |||||
*/ | |||||
protected $model = User::class; | |||||
/** | |||||
* Define the model's default state. | |||||
* | |||||
* @return array | |||||
*/ | |||||
public function definition() | |||||
{ | |||||
return [ | |||||
'name' => $this->faker->name, | |||||
'email' => $this->faker->unique()->safeEmail, | |||||
]; | |||||
} | |||||
} |
@@ -1,18 +0,0 @@ | |||||
<?php | |||||
namespace Database\Seeders; | |||||
use Illuminate\Database\Seeder; | |||||
class DatabaseSeeder extends Seeder | |||||
{ | |||||
/** | |||||
* Run the database seeds. | |||||
* | |||||
* @return void | |||||
*/ | |||||
public function run() | |||||
{ | |||||
// $this->call('UsersTableSeeder'); | |||||
} | |||||
} |