-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #630 from EotvosCollegium/staging
Deploy recent changes
- Loading branch information
Showing
22 changed files
with
776 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
namespace App\Livewire; | ||
|
||
use App\Models\Application; | ||
use App\Models\ApplicationWorkshop; | ||
use Carbon\Carbon; | ||
use Livewire\Component; | ||
|
||
class ApplicationRoleStatusUpdate extends Component | ||
{ | ||
public Application $application; | ||
public Carbon $lastUpdated; | ||
|
||
/** | ||
* Mount the component | ||
* @param Application $application | ||
* @return void | ||
*/ | ||
public function mount(Application $application) | ||
{ | ||
$this->application = $application; | ||
$this->lastUpdated = Carbon::now()->subSeconds(2); | ||
} | ||
|
||
/** | ||
* Update whether the applicant has been admitted as resident or not. | ||
* @param $workshop | ||
*/ | ||
public function switchResidentRole() | ||
{ | ||
$this->authorize('finalize', Application::class); | ||
$this->application->update(['admitted_for_resident_status' => !$this->application->admitted_for_resident_status]); | ||
$this->lastUpdated = Carbon::now(); | ||
} | ||
|
||
/** | ||
* $this->updated | ||
* @return bool | ||
*/ | ||
public function getUpdatedProperty() | ||
{ | ||
return $this->lastUpdated > Carbon::now()->subSeconds(2); | ||
} | ||
|
||
/** | ||
* Render the component | ||
* @return \Illuminate\View\View | ||
*/ | ||
public function render() | ||
{ | ||
return view('auth.application.role_status_update_component'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.