mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-12-02 15:15:31 -05:00
* fix typo * php-cs traits * CS fixer pass * Password protect User routes * Implement checks to prevent editing a deleted record * Clean up payment flows * Fixes for tests
34 lines
639 B
PHP
34 lines
639 B
PHP
<?php
|
|
/**
|
|
* Invoice Ninja (https://invoiceninja.com)
|
|
*
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
*
|
|
* @copyright Copyright (c) 2019. Invoice Ninja LLC (https://invoiceninja.com)
|
|
*
|
|
* @license https://opensource.org/licenses/AAL
|
|
*/
|
|
|
|
namespace App\Utils\Traits;
|
|
|
|
/**
|
|
* Class ChecksEntityStatus
|
|
* @package App\Utils\Traits
|
|
*/
|
|
trait ChecksEntityStatus
|
|
{
|
|
|
|
public function entityIsDeleted($entity)
|
|
{
|
|
|
|
return $entity->is_deleted;
|
|
|
|
}
|
|
|
|
public function disallowUpdate()
|
|
{
|
|
return response()->json(['message'=>'Record is deleted and cannot be edited. Restore the record to enable editing'], 400);
|
|
|
|
}
|
|
|
|
} |