Skip to content

Commit f8088b9

Browse files
author
Surya
committed
FIX laravel 7 compatibility issues
1 parent 6263cad commit f8088b9

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

src/FormModelStack.php

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace Webfox\LaravelForms;
44

5-
use Illuminate\Database\Eloquent\Model;
65
use Illuminate\Support\Collection;
6+
use Illuminate\Database\Eloquent\Model;
77

88
class FormModelStack extends Collection
99
{
@@ -12,23 +12,14 @@ public function __construct($items = [])
1212
parent::__construct($items);
1313
}
1414

15-
public function push($value)
15+
public function current()
1616
{
17-
return parent::push($value);
17+
return parent::last();
1818
}
1919

20-
public function pop()
20+
protected function modelIdentifier(Model $model = null)
2121
{
22-
$popped = parent::pop();
23-
return $popped;
24-
}
25-
26-
public function current() {
27-
return parent::last();
28-
}
29-
30-
protected function modelIdentifier(Model $model = null) {
31-
return $model ? get_class($model) . ' (#' . $model->getKey() .')' : 'null';
22+
return $model ? get_class($model) . ' (#' . $model->getKey() . ')' : 'null';
3223
}
3324

3425

views/container.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
@if($rawLabel ?? false)
99
{!! $rawLabel !!}
1010
@else
11-
{{ $label ?? str_title($name) }}
11+
{{ $label ?? \Illuminate\Support\Str::title($name) }}
1212
@endif
1313
</label>
1414
@endunless

0 commit comments

Comments
 (0)