Skip to content

Commit

Permalink
Update structure to reflect new livewire location
Browse files Browse the repository at this point in the history
  • Loading branch information
csrui committed Jan 9, 2024
1 parent 41ad1ad commit 9793fda
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"type": "library",
"require": {
"php": "^8.0",
"spatie/laravel-package-tools": "^1.14",
"livewire/livewire": "^2.10"
"spatie/laravel-package-tools": "^1.14"
},
"license": "MIT",
"autoload": {
Expand Down
3 changes: 2 additions & 1 deletion resources/views/livewire/editor.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<div>
XXXX
@if ($usersWithPermission->isNotEmpty())
<div class="mb-6">
<h3 class="text-xs font-semibold tracking-wide text-gray-500 uppercase">{{ __('Users with permission') }}</h3>
Expand Down Expand Up @@ -27,7 +28,7 @@ class="rounded-full hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-
<div class="sm:flex sm:items-center">
<label for="emails" class="sr-only">@lang('Search for')</label>
<div class="relative sm:min-w-0 sm:flex-1">
<input type="text" name="emails" id="emails" class="rounded-md shadow-sm block w-full pr-32 border-gray-300 focus:ring-green-500 focus:border-green-500 sm:text-sm" wire:model="query" placeholder="Enter a name or email">
<input type="text" name="emails" id="emails" autocomplete="off" class="rounded-md shadow-sm block w-full pr-32 border-gray-300 focus:ring-green-500 focus:border-green-500 sm:text-sm" wire:model="query" placeholder="Enter a name or email">
</div>
<div class="mt-3 sm:mt-0 sm:ml-4 sm:flex-shrink-0">
<button
Expand Down
6 changes: 5 additions & 1 deletion src/Http/Livewire/Editor.php → src/Livewire/Editor.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace TwentySixB\LaravelPermissions\Http\Livewire;
namespace TwentySixB\LaravelPermissions\Livewire;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Collection;
Expand Down Expand Up @@ -99,6 +99,10 @@ protected function getAction() : AbstractQuery
*/
public function search() : void
{
if (empty($this->query)) {
return;
}

$this->eligebleForPermission = $this->getAction()->search($this->query)->get();
$this->isSearching = true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/PermissionsServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Spatie\LaravelPackageTools\PackageServiceProvider;
use Spatie\LaravelPackageTools\Package;
use TwentySixB\LaravelPermissions\Http\Livewire\Editor;
use TwentySixB\LaravelPermissions\Livewire\Editor;
use Livewire\Livewire;

/**
Expand Down

0 comments on commit 9793fda

Please sign in to comment.