Client added to login, admin panel finished
This commit is contained in:
parent
7da271d37b
commit
e9f3fdfd38
|
|
@ -39,13 +39,7 @@ public function setup()
|
|||
*/
|
||||
protected function setupListOperation()
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* Columns can be defined using the fluent syntax or array syntax:
|
||||
* - CRUD::column('price')->type('number');
|
||||
* - CRUD::addColumn(['name' => 'price', 'type' => 'number']);
|
||||
*/
|
||||
$this->crud->setFromDb();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -79,7 +73,23 @@ protected function setupCreateOperation()
|
|||
'type' => 'upload',
|
||||
'upload' => true,
|
||||
'disk' => 'uploads', // if you store files in the /public folder, please ommit this; if you store them in /storage or S3, please specify it;
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => 'document_id',
|
||||
'type' => 'select',
|
||||
'label' => 'Document',
|
||||
'entity' => 'document',
|
||||
'model' => "App\Models\Document",
|
||||
'attribute' => 'name_ru'
|
||||
],
|
||||
[
|
||||
'name' => 'application_id',
|
||||
'type' => 'select',
|
||||
'label' => 'Application',
|
||||
'entity' => 'application',
|
||||
'model' => "App\Models\Application",
|
||||
'attribute' => 'account_id'
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class DocumentCrudController extends CrudController
|
|||
|
||||
/**
|
||||
* Configure the CrudPanel object. Apply settings to all operations.
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setup()
|
||||
|
|
@ -33,43 +33,66 @@ public function setup()
|
|||
|
||||
/**
|
||||
* Define what happens when the List operation is loaded.
|
||||
*
|
||||
*
|
||||
* @see https://backpackforlaravel.com/docs/crud-operation-list-entries
|
||||
* @return void
|
||||
*/
|
||||
protected function setupListOperation()
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* Columns can be defined using the fluent syntax or array syntax:
|
||||
* - CRUD::column('price')->type('number');
|
||||
* - CRUD::addColumn(['name' => 'price', 'type' => 'number']);
|
||||
*/
|
||||
$this->crud->setFromDb();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define what happens when the Create operation is loaded.
|
||||
*
|
||||
*
|
||||
* @see https://backpackforlaravel.com/docs/crud-operation-create
|
||||
* @return void
|
||||
*/
|
||||
protected function setupCreateOperation()
|
||||
{
|
||||
CRUD::setValidation(DocumentRequest::class);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Fields can be defined using the fluent syntax or array syntax:
|
||||
* - CRUD::field('price')->type('number');
|
||||
* - CRUD::addField(['name' => 'price', 'type' => 'number']));
|
||||
*/
|
||||
$this->crud->addFields([
|
||||
[
|
||||
'name' => 'name_ru',
|
||||
'type' => 'text',
|
||||
'label' => 'Name ru'
|
||||
],
|
||||
[
|
||||
'name' => 'name_en',
|
||||
'type' => 'text',
|
||||
'label' => 'Name en'
|
||||
],
|
||||
[
|
||||
'name' => 'name_tm',
|
||||
'type' => 'text',
|
||||
'label' => 'Name tm'
|
||||
],
|
||||
[
|
||||
'name' => 'description_ru',
|
||||
'type' => 'textarea',
|
||||
'label' => 'Description ru'
|
||||
],
|
||||
[
|
||||
'name' => 'description_en',
|
||||
'type' => 'textarea',
|
||||
'label' => 'Description en'
|
||||
],
|
||||
[
|
||||
'name' => 'description_tm',
|
||||
'type' => 'textarea',
|
||||
'label' => 'Description tm'
|
||||
],
|
||||
[
|
||||
'name' => 'max_size',
|
||||
'type' => 'text',
|
||||
'label' => 'Max size'
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Define what happens when the Update operation is loaded.
|
||||
*
|
||||
*
|
||||
* @see https://backpackforlaravel.com/docs/crud-operation-update
|
||||
* @return void
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class DocumentgroupCrudController extends CrudController
|
|||
|
||||
/**
|
||||
* Configure the CrudPanel object. Apply settings to all operations.
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setup()
|
||||
|
|
@ -33,24 +33,18 @@ public function setup()
|
|||
|
||||
/**
|
||||
* Define what happens when the List operation is loaded.
|
||||
*
|
||||
*
|
||||
* @see https://backpackforlaravel.com/docs/crud-operation-list-entries
|
||||
* @return void
|
||||
*/
|
||||
protected function setupListOperation()
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* Columns can be defined using the fluent syntax or array syntax:
|
||||
* - CRUD::column('price')->type('number');
|
||||
* - CRUD::addColumn(['name' => 'price', 'type' => 'number']);
|
||||
*/
|
||||
$this->crud->setFromDb();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define what happens when the Create operation is loaded.
|
||||
*
|
||||
*
|
||||
* @see https://backpackforlaravel.com/docs/crud-operation-create
|
||||
* @return void
|
||||
*/
|
||||
|
|
@ -58,18 +52,48 @@ protected function setupCreateOperation()
|
|||
{
|
||||
CRUD::setValidation(DocumentgroupRequest::class);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Fields can be defined using the fluent syntax or array syntax:
|
||||
* - CRUD::field('price')->type('number');
|
||||
* - CRUD::addField(['name' => 'price', 'type' => 'number']));
|
||||
*/
|
||||
$this->crud->addField([
|
||||
[
|
||||
'name' => 'name_ru',
|
||||
'type' => 'text',
|
||||
'label' => 'Name ru'
|
||||
],
|
||||
[
|
||||
'name' => 'name_en',
|
||||
'type' => 'text',
|
||||
'label' => 'Name en'
|
||||
],
|
||||
[
|
||||
'name' => 'name_tm',
|
||||
'type' => 'text',
|
||||
'label' => 'Name tm'
|
||||
],
|
||||
[
|
||||
'name' => 'description_ru',
|
||||
'type' => 'textarea',
|
||||
'label' => 'Description ru'
|
||||
],
|
||||
[
|
||||
'name' => 'description_en',
|
||||
'type' => 'textarea',
|
||||
'label' => 'Description en'
|
||||
],
|
||||
[
|
||||
'name' => 'description_tm',
|
||||
'type' => 'textarea',
|
||||
'label' => 'Description tm'
|
||||
],
|
||||
[
|
||||
'name' => 'type',
|
||||
'type' => 'text',
|
||||
'label' => 'Type'
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Define what happens when the Update operation is loaded.
|
||||
*
|
||||
*
|
||||
* @see https://backpackforlaravel.com/docs/crud-operation-update
|
||||
* @return void
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class QuestionCrudController extends CrudController
|
|||
|
||||
/**
|
||||
* Configure the CrudPanel object. Apply settings to all operations.
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setup()
|
||||
|
|
@ -33,24 +33,18 @@ public function setup()
|
|||
|
||||
/**
|
||||
* Define what happens when the List operation is loaded.
|
||||
*
|
||||
*
|
||||
* @see https://backpackforlaravel.com/docs/crud-operation-list-entries
|
||||
* @return void
|
||||
*/
|
||||
protected function setupListOperation()
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* Columns can be defined using the fluent syntax or array syntax:
|
||||
* - CRUD::column('price')->type('number');
|
||||
* - CRUD::addColumn(['name' => 'price', 'type' => 'number']);
|
||||
*/
|
||||
$this->crud->setFromDb();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define what happens when the Create operation is loaded.
|
||||
*
|
||||
*
|
||||
* @see https://backpackforlaravel.com/docs/crud-operation-create
|
||||
* @return void
|
||||
*/
|
||||
|
|
@ -58,18 +52,23 @@ protected function setupCreateOperation()
|
|||
{
|
||||
CRUD::setValidation(QuestionRequest::class);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Fields can be defined using the fluent syntax or array syntax:
|
||||
* - CRUD::field('price')->type('number');
|
||||
* - CRUD::addField(['name' => 'price', 'type' => 'number']));
|
||||
*/
|
||||
CRUD::addFields([
|
||||
[
|
||||
'name' => 'question_text',
|
||||
'type' => 'textarea',
|
||||
'label' => 'Question text'
|
||||
],
|
||||
[
|
||||
'name' => 'options',
|
||||
'type' => 'text',
|
||||
'label' => 'Options'
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Define what happens when the Update operation is loaded.
|
||||
*
|
||||
*
|
||||
* @see https://backpackforlaravel.com/docs/crud-operation-update
|
||||
* @return void
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ public function login(Request $request){
|
|||
$tokenResult = $client->createToken('auth_token');
|
||||
|
||||
// return token in json response
|
||||
return response()->json(['success' => ['token' => $tokenResult]], 200);
|
||||
return response()->json(['success' => ['token' => $tokenResult, 'client' => $client]], 200);
|
||||
}
|
||||
return response()->json(['error' => ['message' => 'email not found']], 404);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,15 @@ class Document extends Model
|
|||
// protected $primaryKey = 'id';
|
||||
// public $timestamps = false;
|
||||
protected $guarded = ['id'];
|
||||
// protected $fillable = [];
|
||||
protected $fillable = [
|
||||
'name_ru',
|
||||
'name_tm',
|
||||
'name_en',
|
||||
'description_ru',
|
||||
'description_en',
|
||||
'description_tm',
|
||||
'max_size'
|
||||
];
|
||||
// protected $hidden = [];
|
||||
// protected $dates = [];
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,15 @@ class Documentgroup extends Model
|
|||
// protected $primaryKey = 'id';
|
||||
// public $timestamps = false;
|
||||
protected $guarded = ['id'];
|
||||
// protected $fillable = [];
|
||||
protected $fillable = [
|
||||
'name_en',
|
||||
'name_ru',
|
||||
'name_tm',
|
||||
'description_ru',
|
||||
'description_tm',
|
||||
'description_en',
|
||||
'type'
|
||||
];
|
||||
// protected $hidden = [];
|
||||
// protected $dates = [];
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,10 @@ class Question extends Model
|
|||
// protected $primaryKey = 'id';
|
||||
// public $timestamps = false;
|
||||
protected $guarded = ['id'];
|
||||
// protected $fillable = [];
|
||||
protected $fillable = [
|
||||
'question_text',
|
||||
'options'
|
||||
];
|
||||
// protected $hidden = [];
|
||||
// protected $dates = [];
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue