I added the Macro below, but getting an error where have i made the mistake?

|
Rlghld_alzoubi 2021-12-02 06:26:47
i stored in a file json ( email,password username )
not in a databases in a file json
Please How can i access to the token for this emails ?
reachmerajesh 2021-12-02 06:55:02
I need laravel developer.
Preferred location tamil nadu
reachmerajesh 2021-12-02 06:55:13
Ping me
iGlennio 2021-12-02 07:40:13
I’m looking for a Laravel PHP developer to partner with in SaaS project development.
Vynch 2021-12-02 09:05:57
iGlennio 2021-12-02 07:40:13
I’m looking for a Laravel PHP developer to partner with in SaaS project development.

Is it a paid or free partnership

reachmerajesh 2021-12-02 10:33:10
Vynch 2021-12-02 09:05:57
Is it a paid or free partnership

Paid

neelbas 2021-12-02 11:11:27
is possible to use the schedule->lastDayOfMonth() for other type of calendar? ( such as Jalali or Shamsi )
TheGuyi 2021-12-02 11:35:32
laravel_discuss-101257.jpg
hello experts, when i try to search like this i get error
TheGuyi 2021-12-02 11:35:33
laravel_discuss-101258.jpg

TheGuyi 2021-12-02 11:38:06
TheGuyi 2021-12-02 11:35:32
hello experts, when i try to search like this i get error

laravel_discuss-101260.jpg

TheGuyi 2021-12-02 11:38:06
TheGuyi 2021-12-02 11:35:32
hello experts, when i try to search like this i get error

laravel_discuss-101259.jpg
then when i change to ursb::all() i get error below yet the field is there in the database and also in the model fillable, where have i gone wrong?

TheGuyi 2021-12-02 11:49:29
laravel_discuss-101261.jpg
Hi gurus, i am failing to get the order By to work with the error
BadMethodCallException
Method IlluminateDatabaseEloquentCollection::orderBy does not exist.

what am i doing wrong? please help me

BaronNo1 2021-12-02 11:51:58
TheGuyi 2021-12-02 11:49:29
Hi gurus, i am failing to get the order By to work with the error
BadMethodCallException
Method IlluminateDatabaseEloquentCollection::orderBy does not exist.

what am i doing wrong? please help me

try replacing “$this->sort” with “desc” meaing descending. whats the output?

EmmanuelTorty 2021-12-02 11:52:27
TheGuyi 2021-12-02 11:38:06

$this->search is empty.

TheGuyi 2021-12-02 11:52:40
EmmanuelTorty 2021-12-02 11:52:27
$this->search is empty.

how do i fix?

EmmanuelTorty 2021-12-02 11:53:10
TheGuyi 2021-12-02 11:52:40
how do i fix?

Where are you getting the value from?

TheGuyi 2021-12-02 11:53:41
EmmanuelTorty 2021-12-02 11:53:10
Where are you getting the value from?

what do you mean?

BaronNo1 2021-12-02 11:54:07
TheGuyi 2021-12-02 11:53:41
what do you mean?

i think he is asking about the $this->sort and stuff?

TheGuyi 2021-12-02 11:55:45
BaronNo1 2021-12-02 11:51:58
try replacing “$this->sort” with “desc” meaing descending. whats the output?

BadMethodCallException
Method IlluminateDatabaseEloquentCollection::orderBy does not exist.

EmmanuelTorty 2021-12-02 11:56:18
TheGuyi 2021-12-02 11:53:41
what do you mean?

$this->search

Where does this come from?

TheGuyi 2021-12-02 11:56:55
EmmanuelTorty 2021-12-02 11:56:18
$this->search

Where does this come from?

from the front end, i am trying to search for names from the DB

TheGuyi 2021-12-02 11:57:16
public function render()
{

return view(‘livewire.request-index’,
[
‘series’ => Ursb::all(‘ursbname’, $this->search)->orderBy(‘id’, $this->sort)->paginate($this->perPage)] );
}

TheGuyi 2021-12-02 11:58:08
TheGuyi 2021-12-02 11:57:16
public function render()
{

return view(‘livewire.request-index’,
[
‘series’ => Ursb::all(‘ursbname’, $this->search)->orderBy(‘id’, $this->sort)->paginate($this->perPage)] );
}

only thing working is the paginate i can select from the drop down, the search brings error and the sort/orderby

TheGuyi 2021-12-02 11:59:13
TheGuyi 2021-12-02 11:57:16
public function render()
{

return view(‘livewire.request-index’,
[
‘series’ => Ursb::all(‘ursbname’, $this->search)->orderBy(‘id’, $this->sort)->paginate($this->perPage)] );
}

even if i do it like this

public function render()
{
return view(‘livewire.request-index’,
[ ‘series’ => Ursb::search(‘ursbname’, $this->search)->orderBy(‘id’, $this->sort)->paginate($this->perPage)] );
}

EmmanuelTorty 2021-12-02 11:59:47
TheGuyi 2021-12-02 11:57:16
public function render()
{

return view(‘livewire.request-index’,
[
‘series’ => Ursb::all(‘ursbname’, $this->search)->orderBy(‘id’, $this->sort)->paginate($this->perPage)] );
}

do dd($this->search);

To see what the frontend is sending to you

TheGuyi 2021-12-02 12:06:06
TheGuyi 2021-12-02 11:59:13
even if i do it like this

public function render()
{
return view(‘livewire.request-index’,
[ ‘series’ => Ursb::search(‘ursbname’, $this->search)->orderBy(‘id’, $this->sort)->paginate($this->perPage)] );
}

laravel_discuss-101276.jpg
this is what i am trying to archive am i doing it wrong?

TheGuyi 2021-12-02 12:06:21
using jetstream
TheGuyi 2021-12-02 12:32:54
laravel_discuss-101279.jpg

TheGuyi 2021-12-02 12:32:54
laravel_discuss-101278.jpg
any ideas on this error?
TheGuyi 2021-12-02 12:39:44
TheGuyi 2021-12-02 12:32:54
any ideas on this error?

BadMethodCallException
Call to undefined method IlluminateDatabaseEloquentBuilder::Search()

RdotDev 2021-12-02 12:40:06
TheGuyi 2021-12-02 12:32:54
any ideas on this error?

Use where instead of search

TheGuyi 2021-12-02 12:43:47
RdotDev 2021-12-02 12:40:06
Use where instead of search

the table is empty when i put where

public $search ;

return view(‘livewire.request-index’,
[ ‘series’ => Ursb::where(‘ursbname’, $this->search)
->orderBy(‘ursb_status’, $this->sort)
->paginate($this->perPage)
,
]);

RdotDev 2021-12-02 12:53:17
TheGuyi 2021-12-02 12:43:47
the table is empty when i put where

public $search ;

return view(‘livewire.request-index’,
[ ‘series’ => Ursb::where(‘ursbname’, $this->search)
->orderBy(‘ursb_status’, $this->sort)
->paginate($this->perPage)
,
]);

whereLike(‘ursbname’, ‘%’.$this->search.’%’)

Acird Burn 2021-12-02 12:54:17
Has anyone used the InfyOm Laravel Generator how exactly can we bypass its permissions it how do the permissions work like exactly
TheGuyi 2021-12-02 13:03:02
laravel_discuss-101286.jpg
I added the Macro below, but getting an error where have i made the mistake?
Builder::macro(‘search’, function (string $attribute, string $search) {
return $search ? $this->where($attribute, ‘LIKE’, “%{$search}%”) : $this;
});
|