Changed be able to edit names

This commit is contained in:
williamengbjerg committed 2021-06-06 23:00:54 +02:00
1 parent 072d54f46f
commit a9cd16d987
3 files changed
+11 -2

No files matched your search

+5
View File
@@ -230,6 +230,11 @@ class Projected extends Component
return $query->where('user_id', \Auth::user()->id);
})->where("id", $this->rowPostID)->first();
if ($post->name !== $this->rowName) {
$post->update(['name' => $this->rowName]);
$post->save();
}
$value = null;
if($this->rowValue != null && trim($this->rowValue) != "" && is_numeric(trim($this->rowValue))) {
$value = floatval($this->rowValue);
+1
View File
@@ -10,6 +10,7 @@ class Post extends Model
use HasFactory;
private $monthValueCache = null;
private $monthActualValueCache = null;
protected $guarded = [];
public function category() {
return $this->belongsTo(\App\Models\Category::class);
+5 -2
View File
@@ -192,7 +192,7 @@
<div>
<div class="mt-1 text-center sm:mt-1">
<h3 class="text-lg leading-6 font-medium text-gray-900" id="modal-title-1">
{{$fieldName}} for ({{$fieldMonthName}})
{{$fieldName}} for ({{$fieldMonthName}}) <br>
</h3>
<div class="mt-2">
<p class="text-sm text-gray-500">
@@ -224,7 +224,10 @@
<div>
<div class="mt-1 text-center sm:mt-1">
<h3 class="text-lg leading-6 font-medium text-gray-900" id="modal-title-2">
{{$rowName}}
<label for="set-title">
{{$fieldName}} for ({{$fieldMonthName}}) <br>
<input id="set-title" name="title" type="text" wire:model.defer="rowName" class="form-input px-2 py-2 rounded-md w-10/12" />
</label>
</h3>
<div class="mt-2">
<p class="text-sm text-gray-500">