Modificar (Estandar->Cabecera)
This commit is contained in:
parent
3079477eb0
commit
a90ab4f0dc
@ -12,15 +12,18 @@ class EstandarController extends Controller
|
|||||||
public function createEstandar(Request $request){
|
public function createEstandar(Request $request){
|
||||||
$request->validate([
|
$request->validate([
|
||||||
"name"=>"required",
|
"name"=>"required",
|
||||||
|
"cabecera"=>"required",
|
||||||
]);
|
]);
|
||||||
$id_user = auth()->user()->id;
|
$id_user = auth()->user()->id;
|
||||||
$estandar = new Estandar();
|
$estandar = new Estandar();
|
||||||
$estandar->id_user = $id_user;
|
$estandar->id_user = $id_user;
|
||||||
$estandar->name = $request->name;
|
$estandar->name = $request->name;
|
||||||
|
$estandar->cabecera = $request->cabecera;
|
||||||
$estandar->save();
|
$estandar->save();
|
||||||
return response([
|
return response([
|
||||||
"status" => 1,
|
"status" => 1,
|
||||||
"msg" => "!Estandar creado exitosamente",
|
"msg" => "!Estandar creado exitosamente",
|
||||||
|
"data" => $estandar,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ class Estandar extends Model
|
|||||||
protected $table ='estandars';
|
protected $table ='estandars';
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'name',
|
'name',
|
||||||
|
'cabecera'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ public function up()
|
|||||||
Schema::create('estandars', function (Blueprint $table) {
|
Schema::create('estandars', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->string('name'); //cambiar el name por nombre
|
$table->string('name'); //cambiar el name por nombre
|
||||||
|
$table->mediumText('cabecera');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
//$table->foreign('id_user')->references('id')->on('users');
|
//$table->foreign('id_user')->references('id')->on('users');
|
||||||
$table->foreignId('id_user')
|
$table->foreignId('id_user')
|
||||||
|
Loading…
Reference in New Issue
Block a user