Skip to content

Commit

Permalink
Update validator and namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
muath-ye committed Aug 4, 2022
1 parent 2b3fe85 commit 4a17e73
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ function {{ str_replace('[]', '', $name) }}_stringInputUpdated(element) {
let inputIndex = "{{ str_replace('[]', '', $name) }}";
let rules = "{{ $rules }}"
let data = {
lang: '{{app()->getLocale()}}',
name: inputIndex,
inputIndex: element.value,
rules: {
Expand Down
3 changes: 1 addition & 2 deletions src/BladeRealtimeInputServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
use YemeniOpenSource\BladeRealtimeInput\Components\Forms\StringInput;

class BladeRealtimeInputServiceProvider extends ServiceProvider
{
Expand All @@ -17,7 +16,7 @@ public function boot()
{
// Blade::component('string-input', StringInput::class);
Blade::componentNamespace('YemeniOpenSource\\BladeRealtimeInput\\Components\\Forms', 'realtime-input');
$this->loadViewsFrom(__DIR__.'/../resources/views', 'realtime-input');
$this->loadViewsFrom(__DIR__.'/../resources/views/components/forms', 'realtime-input');
$this->loadRoutesFrom(__DIR__.'/routes.php');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Illuminate\View\Component;

class StringInput extends Component
class Strings extends Component
{
public $name;

Expand All @@ -32,6 +32,6 @@ public function __construct($name, $rules)
*/
public function render()
{
return view('realtime-input::components.forms.string-input');
return view('realtime-input::strings');
}
}
2 changes: 1 addition & 1 deletion src/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
$request->all(),
$request->rules,
[],
['inputIndex' => $request->name]
['inputIndex' => __('validation.attributes.'.$request->name)]
);
if ($validator->fails()) {
return response()->json($validator->errors());
Expand Down

0 comments on commit 4a17e73

Please sign in to comment.