Skip to content

Instantly share code, notes, and snippets.

@tabuna
Created January 14, 2019 19:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tabuna/f13450aad15a023d49213662eec6167b to your computer and use it in GitHub Desktop.
Save tabuna/f13450aad15a023d49213662eec6167b to your computer and use it in GitHub Desktop.
User.php
<?php
namespace App;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Notifications\Notifiable;
use Orchid\Platform\Models\User as Authenticatable;
use Orchid\Screen\Fields\InputField;
class User extends Authenticatable implements MustVerifyEmail
{
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email', 'password',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];
/**
* @return \Illuminate\Support\Collection
*/
public static function modelFields()
{
return collect([
'name' => InputField::make('user.name')
->type('text')
->required()
->title(__('Name'))
->placeholder(__('Name')),
'email' => InputField::make('user.email')
->type('email')
->required()
->title(__('Email'))
->placeholder(__('Email')),
]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment