Can i make one controller for working with two tables in the same pages?

|
sobirjonovs 2020-10-27 07:45:48
well?
2020-10-27 07:46:43
check this :
set session flash on server and delete your client : delete history all web browser
and check the session flash : and you see clear session flash too
2020-10-27 07:47:15
if(session()->has(‘level’))
{
session()->reflash(‘level’);
$level=session()->get(‘level’);
return view(‘auth.register’,compact(‘level’));
}
2020-10-27 07:47:57
this my example and worked but when i,m delete myHistoryBrowser , ?! oops delete session too
2020-10-27 07:48:45
because i,m think define flash session maybe connect to coockie or request (but i,m no know how ?!!)
sobirjonovs 2020-10-27 07:52:39
2020-10-27 07:47:57
this my example and worked but when i,m delete myHistoryBrowser , ?! oops delete session too

yes, it will be deleted.

2020-10-27 07:53:14
2020-10-27 07:48:45
because i,m think define flash session maybe connect to coockie or request (but i,m no know how ?!!)

and also to say : i,m know session flash can alive just one request

2020-10-27 07:54:51
2020-10-27 07:47:15
if(session()->has(‘level’))
{
session()->reflash(‘level’);
$level=session()->get(‘level’);
return view(‘auth.register’,compact(‘level’));
}

but i,m reflash again and this must worked
worked allways
but not worked when i,m delete history browser ? and i,m confusedd ??!!

sobirjonovs 2020-10-27 07:55:38
if(session()->has(‘level’))
{
session()->reflash(‘level’);
session()->keep(‘level’);
$level=session()->get(‘level’);
return view(‘auth.register’,compact(‘level’));
}

try it maybe works as you want

2020-10-27 07:56:10
sobirjonovs 2020-10-27 07:55:38
if(session()->has(‘level’))
{
session()->reflash(‘level’);
session()->keep(‘level’);
$level=session()->get(‘level’);
return view(‘auth.register’,compact(‘level’));
}

try it maybe works as you want

ok let me i,m try

2020-10-27 07:57:34
no not worked
2020-10-27 07:58:31
you know i,m not need this
i,m just want completely understand how php worked
2020-10-27 07:58:51
sobirjonovs 2020-10-27 07:55:38
if(session()->has(‘level’))
{
session()->reflash(‘level’);
session()->keep(‘level’);
$level=session()->get(‘level’);
return view(‘auth.register’,compact(‘level’));
}

try it maybe works as you want

anyway thank you

sobirjonovs 2020-10-27 08:10:23
2020-10-27 07:58:31
you know i,m not need this
i,m just want completely understand how php worked

ok)

2020-10-27 08:30:08
laravel_discuss-56728.jpg
how to get total array length? how to convert array length into string?
skys215 2020-10-27 08:31:38
2020-10-27 08:30:08
how to get total array length? how to convert array length into string?

count ()

2020-10-27 08:33:00
I am using count… but, I am getting this error:- count(): Parameter must be an array or an object that implements Countable
2020-10-27 08:33:11
skys215 2020-10-27 08:31:38
count ()

I am using count… but, I am getting this error:- count(): Parameter must be an array or an object that implements Countable

skys215 2020-10-27 08:33:33
Show your code
2020-10-27 10:36:46
2020-10-27 08:30:08
how to get total array length? how to convert array length into string?

Probably this is because it’s not model. It’s json string

Munish Kumar 2020-10-27 12:04:37
frd if i want to show different different functions data to one page then how can i show
Munish Kumar 2020-10-27 12:06:16
please
2020-10-27 12:42:11
Use components
2020-10-27 12:43:22
Or make query for all the data you need, assign it to variable, pass it to view.
TheFeLuM 2020-10-27 12:53:31
hi guys who can help me in display some data from DB i try to make this an wont work
TheFeLuM 2020-10-27 12:53:48
laravel_discuss-56742.jpg

TheFeLuM 2020-10-27 12:54:01
laravel_discuss-56743.jpg

TheFeLuM 2020-10-27 12:54:14
laravel_discuss-56744.jpg

TheFeLuM 2020-10-27 12:54:27
laravel_discuss-56745.jpg

TheFeLuM 2020-10-27 12:54:38
laravel_discuss-56746.jpg

2020-10-27 13:08:15
hi first in public show :
return $servicii
2020-10-27 13:08:49
if not worked, problem is in model or database
if worked
problem is in view
udev21 2020-10-27 13:09:46
TheFeLuM 2020-10-27 12:54:14

move /servicii/{id} after servicii/{id}

2020-10-27 13:10:20
TheFeLuM 2020-10-27 12:54:14

oh yeh problem is here

2020-10-27 13:10:37
then solve?
2020-10-27 13:11:46
your url very bad you must define like this :
servicii/add-service
2020-10-27 13:12:01
for robots google and seo is better
2020-10-27 13:15:10
Guys in RegisterController in method register

if ($response = $this->registered($request, $user)) {
return $response;
}

this code
and this code too

return $request->wantsJson()
? new Response(”, 201)
: redirect($this->redirectPath());

exactly those codes What are they doing?

natghi2010 2020-10-27 13:27:30
2020-10-27 13:11:46
your url very bad you must define like this :
servicii/add-service

i dont think its a public website

TheFeLuM 2020-10-27 13:28:04
problem is i call two controller in one blade
TheFeLuM 2020-10-27 13:28:23
and he can’t took both of them just one of them
TheFeLuM 2020-10-27 13:28:46
can i make one controller for working with two tables in the same pages?
2020-10-27 13:30:07
TheFeLuM 2020-10-27 13:28:46
can i make one controller for working with two tables in the same pages?

you have two variable in one blade is that right ?

2020-10-27 13:30:44
i,m no understand exactly what you want ?
2020-10-27 13:34:22
TheFeLuM 2020-10-27 13:28:46
can i make one controller for working with two tables in the same pages?

but you can set and define someVariable with view composers

2020-10-27 13:34:33
https://laravel.com/docs/8.x/views#view-composers
TheFeLuM 2020-10-27 13:35:48
2020-10-27 13:30:07
you have two variable in one blade is that right ?

нуы

TheFeLuM 2020-10-27 13:35:58
2020-10-27 13:30:07
you have two variable in one blade is that right ?

yes

2020-10-27 13:36:46
and too you can define variable in blade like this
@php $variable= ….. @endphp
DanteFrank 2020-10-27 14:00:00
laravel_discuss-56769.jpg
Hey guys. So I created a controller but each time I try to load it through the view, it tells me the controller does not exist. Please review my code and a work around this please. Thanks
|