Model
namespace App;
use Illuminate\Database\Eloquent\Model;
class YourModel extends Model
{
protected $fillable = ['id','field1', 'field2', 'field3', 'is_active'];
}
Controller
$yourModel = new YourModel();
$data = $request->except('id'); // Exclude 'id' field from the request data
$data['is_active'] = 'Y';
$yourModel->fill($data);
$yourModel->save();
No comments:
Post a Comment