Skip to content

Commit

Permalink
Merge branch 'pr/349' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
danharrin committed Apr 19, 2021
2 parents 69be890 + de89b34 commit bfa1e81
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Filament\Resources\RelationManager\Concerns;
namespace Filament\Resources\Concerns;

trait CanCallHooks
{
Expand Down
12 changes: 3 additions & 9 deletions src/Resources/Pages/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

namespace Filament\Resources\Pages;

use Filament\Resources\Concerns\CanCallHooks;
use Filament\Resources\Route;
use Illuminate\Support\Str;

class Page extends \Filament\Pages\Page
{
use CanCallHooks;

public static $resource;

public static function getModel()
Expand Down Expand Up @@ -39,13 +42,4 @@ protected function authorize($action)

abort_unless($this->{$method}() ?? true, 403);
}

protected function callHook($hook)
{
if (! method_exists($this, $hook)) {
return;
}

$this->{$hook}();
}
}
3 changes: 2 additions & 1 deletion src/Resources/RelationManager/AttachRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
use Filament\Forms\Components\Select;
use Filament\Forms\Form;
use Filament\Forms\HasForm;
use Filament\Resources\Concerns\CanCallHooks;
use Filament\Resources\Forms\Actions;
use Illuminate\Support\Str;
use Livewire\Component;

class AttachRecord extends Component
{
use Concerns\CanCallHooks;
use CanCallHooks;
use HasForm;

public $manager;
Expand Down
3 changes: 2 additions & 1 deletion src/Resources/RelationManager/CreateRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

namespace Filament\Resources\RelationManager;

use Filament\Resources\Concerns\CanCallHooks;
use Filament\Resources\Forms\Actions;
use Filament\Resources\Forms\Form;
use Filament\Resources\Forms\HasForm;
use Livewire\Component;

class CreateRecord extends Component
{
use Concerns\CanCallHooks;
use CanCallHooks;
use HasForm;

public $manager;
Expand Down
3 changes: 2 additions & 1 deletion src/Resources/RelationManager/EditRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
namespace Filament\Resources\RelationManager;

use Filament\Filament;
use Filament\Resources\Concerns\CanCallHooks;
use Filament\Resources\Forms\Actions;
use Filament\Resources\Forms\Form;
use Filament\Resources\Forms\HasForm;
use Livewire\Component;

class EditRecord extends Component
{
use Concerns\CanCallHooks;
use CanCallHooks;
use HasForm;

public $manager;
Expand Down
3 changes: 2 additions & 1 deletion src/Resources/RelationManager/ListRecords.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
namespace Filament\Resources\RelationManager;

use Filament\Filament;
use Filament\Resources\Concerns\CanCallHooks;
use Filament\Resources\Tables\HasTable;
use Filament\Resources\Tables\RecordActions;
use Filament\Resources\Tables\Table;
use Livewire\Component;

class ListRecords extends Component
{
use Concerns\CanCallHooks;
use CanCallHooks;
use HasTable;

public $canAttach;
Expand Down

0 comments on commit bfa1e81

Please sign in to comment.