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){
|
||||
$request->validate([
|
||||
"name"=>"required",
|
||||
"cabecera"=>"required",
|
||||
]);
|
||||
$id_user = auth()->user()->id;
|
||||
$estandar = new Estandar();
|
||||
$estandar->id_user = $id_user;
|
||||
$estandar->name = $request->name;
|
||||
$estandar->cabecera = $request->cabecera;
|
||||
$estandar->save();
|
||||
return response([
|
||||
"status" => 1,
|
||||
"msg" => "!Estandar creado exitosamente",
|
||||
"data" => $estandar,
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,7 @@ class Estandar extends Model
|
||||
protected $table ='estandars';
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'cabecera'
|
||||
];
|
||||
|
||||
|
||||
|
@ -16,6 +16,7 @@ public function up()
|
||||
Schema::create('estandars', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name'); //cambiar el name por nombre
|
||||
$table->mediumText('cabecera');
|
||||
$table->timestamps();
|
||||
//$table->foreign('id_user')->references('id')->on('users');
|
||||
$table->foreignId('id_user')
|
||||
|
Loading…
Reference in New Issue
Block a user