I have homestead do i need mysql?

|
ErgashevXurshid 2019-06-25 21:04:27
Ok but you have 2 errors in your controller
1) you wrote without array or compact. Send data like this:
$roles = Role::all();
return view(‘your_blade’, [
‘roles’ => $roles
]);
2) your blade path incorrect
EEEN1993 2019-06-25 21:06:38
ErgashevXurshid 2019-06-25 21:04:27
Ok but you have 2 errors in your controller
1) you wrote without array or compact. Send data like this:
$roles = Role::all();
return view(‘your_blade’, [
‘roles’ => $roles
]);
2) your blade path incorrect

how to make a correct blade path

ErgashevXurshid 2019-06-25 21:08:26
Ok copy this:
view(‘company.home’, [
‘company_department’ => $company_department
]);
ErgashevXurshid 2019-06-25 21:09:52
Can you send me resource derictory screenshots??
senhorY 2019-06-25 21:28:30
ErgashevXurshid 2019-06-25 21:01:43
Not with()
You need array or compact

You can also use with

senhorY 2019-06-25 21:29:03
But view is written with lowercase w
loveycom 2019-06-25 23:11:28
EEEN1993 2019-06-25 20:51:29

Follow @DesolatorMagno approach, tinker. This helps you know if your model returns data in the first place. Better still, put only this in your index method of your controller, visit the route and let’s see what is displayed.

$dep = Department::all();
dd($dep);

Bucciaratti66 2019-06-26 06:19:37
Export data to csv from voyager , is that possible ?
GauravGohil 2019-06-26 11:40:03
How to convert JavaScript in above pic to jquery
GauravGohil 2019-06-26 11:40:04
laravel_discuss-7747.jpg

Prakash D 2019-06-26 11:43:06
how can I use Carousel with customised
2019-06-26 12:34:17
laravel_discuss-7750.jpg
what is my error?
2019-06-26 12:36:57
can anyone help me
StanleyMasinde 2019-06-26 12:38:18
2019-06-26 12:34:17
what is my error?

Install php-mysql from apt

2019-06-26 12:38:56
StanleyMasinde 2019-06-26 12:38:18
Install php-mysql from apt

i have homestead do i need mysql ?

StanleyMasinde 2019-06-26 12:39:33
2019-06-26 12:38:56
i have homestead do i need mysql ?

I am just explaining what what exception means

acrossoffwest 2019-06-26 12:40:16
2019-06-26 12:38:56
i have homestead do i need mysql ?

Do you use Homestead under vagrant?

2019-06-26 12:40:22
acrossoffwest 2019-06-26 12:40:16
Do you use Homestead under vagrant?

yes

acrossoffwest 2019-06-26 12:40:41
2019-06-26 12:40:22
yes

Do you run artisan command from host machine?

2019-06-26 12:40:49
no
2019-06-26 12:40:59
i am running from terminal
2019-06-26 12:41:12
ssh vagrant and then run artisan?
acrossoffwest 2019-06-26 12:41:18
2019-06-26 12:41:12
ssh vagrant and then run artisan?

Yeap

2019-06-26 12:41:27
acrossoffwest 2019-06-26 12:41:18
Yeap

thanks 🙏🏻

acrossoffwest 2019-06-26 12:41:39
And check there php modules
acrossoffwest 2019-06-26 12:41:46
$ php -m
acrossoffwest 2019-06-26 12:42:46
2019-06-26 12:40:59
i am running from terminal

I mean that you use terminal of host machine)

2019-06-26 12:43:38
laravel_discuss-7766.jpg

2019-06-26 12:43:45
upsss
acrossoffwest 2019-06-26 12:44:02
You need to go project folder
2019-06-26 12:51:48
i fixed thanks
vahid_izadyar 2019-06-26 14:44:48
hey guys i have a react project and i want create a laravel project in “api” directory in my react project but i have conflict when i try send request from react to my laravel poject if anyone can help me answer me tnx
ALIREZAJOM 2019-06-26 16:48:44
iam error array_merge(): Argument #2 is not an array in laravel 5.8
skys215 2019-06-26 16:49:24
it’s obvious
skys215 2019-06-26 16:50:17
Argument #2 is not an array
ALIREZAJOM 2019-06-26 16:51:04
How to solve this problem
ALIREZAJOM 2019-06-26 16:51:26
date :
ALIREZAJOM 2019-06-26 16:51:28
array:2 [▼
0 => {#400 ▶️}
1 => {#397 ▶️}
]
ALIREZAJOM 2019-06-26 16:51:44
sento view
skys215 2019-06-26 16:52:00
pass an array on argument2
ALIREZAJOM 2019-06-26 16:52:41
Please give an example
skys215 2019-06-26 16:53:56
please show the code where uses array_merge
ALIREZAJOM 2019-06-26 16:55:54
public function index(Request $request)
{
$users = DB::table(‘users’)->join(‘blog’, ‘users.blogId’, ‘blog.id’)->get();
return view(‘admin.user.index’, compact(‘users’));
}
ALIREZAJOM 2019-06-26 16:56:19
result dd($users):
ALIREZAJOM 2019-06-26 16:56:28
array:2 [▼
0 => {#400 ▶️}
1 => {#397 ▶️}
]
ALIREZAJOM 2019-06-26 16:56:35
error:
ALIREZAJOM 2019-06-26 16:57:15
ErrorException (E_ERROR)
array_merge(): Argument #2 is not an array (View: D:ServerwwwBlogresourcesviewsadminuserindex.blade.php)
ALIREZAJOM 2019-06-26 16:57:33
why?
skys215 2019-06-26 16:59:41
where is the array_merge?
ALIREZAJOM 2019-06-26 17:01:32
I did not use this function
|