941dbd5997
Restores all files to thef8a1310security-review snapshot as requested, plus the 2 boot-critical fixes froma24c8a2(config/session.php env() instead of app()->environment(), and removal of the duplicate $activeTab in ProjectMap.php) so the application actually boots. Forward commit, no history rewrite. The7d854ffstate remains in history. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
45 lines
974 B
PHP
45 lines
974 B
PHP
<?php
|
|
|
|
namespace App\Livewire;
|
|
|
|
use Livewire\Component;
|
|
use App\Models\Project;
|
|
use Illuminate\Support\Facades\Gate;
|
|
|
|
class ProjectEditTabs extends Component
|
|
{
|
|
public Project $project;
|
|
public string $activeTab = 'project-data';
|
|
|
|
public function mount(Project $project)
|
|
{
|
|
Gate::authorize('edit projects', $project);
|
|
$this->project = $project;
|
|
}
|
|
|
|
public function setActiveTab($tab)
|
|
{
|
|
$this->activeTab = $tab;
|
|
}
|
|
|
|
public function tabChanged($tab, $projectId)
|
|
{
|
|
if ($projectId == $this->project->id) {
|
|
$this->activeTab = $tab;
|
|
}
|
|
}
|
|
|
|
public function updateProject()
|
|
{
|
|
Gate::authorize('edit projects', $this->project);
|
|
$this->project->save();
|
|
|
|
session()->flash('message', __('Project updated successfully.'));
|
|
$this->dispatch('project-updated');
|
|
}
|
|
|
|
public function render()
|
|
{
|
|
return view('livewire.project-edit-tabs');
|
|
}
|
|
} |