parent
06fb01d146
commit
6cfd5aa7e9
@ -1,14 +0,0 @@ |
||||
<?php |
||||
|
||||
namespace FlowBox\Exceptions; |
||||
|
||||
class ViewException extends FBRuntimeException |
||||
{ |
||||
public $captured; |
||||
|
||||
public function __construct(\Exception $cause, $captured) |
||||
{ |
||||
$this->captured = $captured; |
||||
parent::__construct($cause); |
||||
} |
||||
} |
@ -0,0 +1,46 @@ |
||||
<?php |
||||
|
||||
namespace MightyPork\Exceptions; |
||||
|
||||
use Illuminate\Contracts\Support\MessageProvider; |
||||
use Illuminate\Support\MessageBag; |
||||
|
||||
class SimpleValidationException extends RuntimeException implements MessageProvider |
||||
{ |
||||
/** @var MessageBag */ |
||||
private $mb; |
||||
|
||||
/** |
||||
* FBValidationException constructor. |
||||
* |
||||
* @param string|MessageProvider $key |
||||
* @param string $message |
||||
*/ |
||||
public function __construct($key, $message = null) |
||||
{ |
||||
if (is_null($message)) { |
||||
$this->mb = $key->getMessageBag(); |
||||
} else { |
||||
$mb = new MessageBag(); |
||||
$mb->add($key, $message); |
||||
$this->mb = $mb; |
||||
} |
||||
|
||||
$str = ''; |
||||
foreach ($this->mb->getMessages() as $key => $errors) { |
||||
$str .= $key . ': ' . implode(', ', $errors) . "\n"; |
||||
} |
||||
|
||||
parent::__construct($str); |
||||
} |
||||
|
||||
/** |
||||
* Get the messages for the instance. |
||||
* |
||||
* @return MessageBag |
||||
*/ |
||||
public function getMessageBag() |
||||
{ |
||||
return $this->mb; |
||||
} |
||||
} |
@ -0,0 +1,27 @@ |
||||
@php |
||||
/** @var \App\Models\Row[]|Illuminate\Pagination\Paginator $rows */ |
||||
@endphp |
||||
|
||||
@extends('table.propose.layout') |
||||
|
||||
@section('tab-content') |
||||
@if($rows->hasPages()) |
||||
<div class="col-md-12 d-flex"> |
||||
<nav class="text-center" aria-label="Pages of the table"> |
||||
{{ $rows->links(null, ['ulClass' => 'mb-0']) }} |
||||
</nav> |
||||
</div> |
||||
@endif |
||||
|
||||
<div class="col-12"> |
||||
@yield('rows') |
||||
</div> |
||||
|
||||
@if($rows->hasPages()) |
||||
<div class="col-md-12 d-flex"> |
||||
<nav class="text-center" aria-label="Pages of the table"> |
||||
{{ $rows->links(null, ['ulClass' => 'mb-0']) }} |
||||
</nav> |
||||
</div> |
||||
@endif |
||||
@stop |
Loading…
Reference in new issue