How did you call method B?

|
zack6849 2019-08-12 00:07:53
That’s probably the laravel collective’s HTML package, it doesn’t exist out of the box in 5.8, however {{ asset(‘css/web.css’) }} will get you the link
zack6849 2019-08-12 00:08:15
GitHub – LaravelCollective/html: HTML and Form Builders for the Laravel Framework
https://github.com/LaravelCollective/html

GitHub – LaravelCollective/html: HTML and Form Builders for the Laravel FrameworkGitHub
HTML and Form Builders for the Laravel Framework. Contribute to LaravelCollective/html development by creating an account on GitHub.
zack6849 2019-08-12 00:09:11
I imagine this just basically prints the same as

<link rel=’stylesheet’ href='{{asset(“css/styles.css”)}}’>

zack6849 2019-08-12 00:12:52
I don’t actually see a style macro for that package so it’s probably a custom macro as well
m 2019-08-12 11:43:53
How i can show my photo’s insagram on laravel site??

What package or ….

skys215 2019-08-12 11:47:40
https://lightwidget.com/

LightWidget | Responsive widget for Instagram
Instagram widget for your website or blog! A responsive Instagram feed with tons of options, easy setup, linking to your Instagram profile.
skys215 2019-08-12 11:47:42
https://snapwidget.com

SnapWidget | Free widgets for your websiteSnapWidget
Embed your photos with a free responsive Instagram widget and social wall. SnapWidget makes it easy to display Instagram, Twitter, Facebook, TikTok and YouTube content on your website.
skys215 2019-08-12 11:47:58
m 2019-08-12 11:43:53
How i can show my photo’s insagram on laravel site??

What package or ….

Just google it and you will find it

m 2019-08-12 11:50:14
skys215 2019-08-12 11:47:58
Just google it and you will find it

Vinkla don’t work
I want get from yours experience that show INSTAGRAM on LARAVEL

skys215 2019-08-12 11:50:48
It has nothing to do with Laravel
skys215 2019-08-12 11:51:04
Have you tried these two?
ldefra 2019-08-12 16:49:49
Hi guys, i have a questione, i have a method A with a custom request and relative validation, if i call it throught web, method A validate request before get in, but if i call method A from method B, method A doesn’t validate request
skys215 2019-08-12 16:51:36
Of course
Because you don’t have the request
ldefra 2019-08-12 16:52:09
Yes i create it and i pass it to method
ldefra 2019-08-12 16:54:55
Maybe web middleware does something?
skys215 2019-08-12 16:57:22
How did you call method B? Through http?
ldefra 2019-08-12 17:01:35
skys215 2019-08-12 16:57:22
How did you call method B? Through http?

Yes

ldefra 2019-08-12 17:02:56
Then i instance a new request compatible with method A and i pass it the parameters
skys215 2019-08-12 17:03:29
it should be an api, is it?
ldefra 2019-08-12 17:05:33
Yes
ldefra 2019-08-12 17:05:48
Or a text data source
skys215 2019-08-12 17:06:19
have you added the Aceept: application/json header or X-Requested-With: XMLHTTPRequest header?
ldefra 2019-08-12 17:06:24
Yes
skys215 2019-08-12 17:06:56
so what’s the response after you called method b through http?
ldefra 2019-08-12 17:14:10
Wait… I repeat i have a store method of controller A, before it get the data throught web form, now the data can come also from api or text source instead, then i call method of controllerApi or controllerTextSource, then they will call store method of controller A passing parameters
ldefra 2019-08-12 17:15:22
If you don’t understand post an example
skys215 2019-08-12 17:20:55
Yeah, but you said you will call method B from method A using GuzzleHttp or curl or something similar. is it right?
ldefra 2019-08-12 17:29:21
skys215 2019-08-12 17:20:55
Yeah, but you said you will call method B from method A using GuzzleHttp or curl or something similar. is it right?

(new ControllerA())->store($request, etc)

skys215 2019-08-12 17:30:24
that’s not through http
skys215 2019-08-12 17:30:56
it won’t get any request to the controller, so of course it won’t check validation
skys215 2019-08-12 17:31:14
write store codes as a service and call the service
ldefra 2019-08-12 17:32:25
skys215 2019-08-12 17:30:24
that’s not through http

It call the first method through http,but not controllerA

skys215 2019-08-12 17:32:39
that’s the problem
DesolatorMagno 2019-08-12 17:33:08
The problem is not the system but the way that you are doing it.
DesolatorMagno 2019-08-12 17:33:52
You could use guzzle and call the API to send the request.
ldefra 2019-08-12 17:34:07
skys215 2019-08-12 17:30:56
it won’t get any request to the controller, so of course it won’t check validation

Yes, i pass the parameters that the first controller get to the request

ldefra 2019-08-12 17:34:48
DesolatorMagno 2019-08-12 17:33:52
You could use guzzle and call the API to send the request.

Yes, i could but i don’t needed

skys215 2019-08-12 17:35:11
then write as a service
DesolatorMagno 2019-08-12 17:35:17
Well you can keep using your hammer them.
skys215 2019-08-12 17:35:19
or other common function
skys215 2019-08-12 17:35:47
or private method of the controller(if it’s in the same controller)
ldefra 2019-08-12 17:39:54
I aren’t understanding
ldefra 2019-08-12 17:41:06
I’m having trouble to traslate
DesolatorMagno 2019-08-12 17:41:43
There are many ways to do what you want to do, but how you are doing it is one of the worst.
ldefra 2019-08-12 17:42:14
Ok!
ldefra 2019-08-12 17:42:33
What’s the best way?
DesolatorMagno 2019-08-12 17:43:00
If you want to access a function inside another function usually you don’t make it public, so you can control it better
DesolatorMagno 2019-08-12 17:43:22
@skys215 told you a couple.
ldefra 2019-08-12 18:03:52
I wrote a small example to know the errors
ldefra 2019-08-12 18:04:15
public function store(PSRequest $request)
{
DB::beginTransaction();
try {
$reservations = $this->parseFile($request);
$controller_reservations = new ControllerReservations();
foreach ($reservations[‘reservations’] as $key_reservation => &$reservation) {
$reservations_request = new ReservationRequest($reservation);
$reservations_request->setMethod($request->getMethod());
$reservations_request->headers->set(‘Accept’, ‘application/json’);
$reservation = $controller_reservations->store($reservations_request);

}
return response()->json([‘status’ => true], 200);

} catch (Exception $e) {
DB::rollback();
return response()->json([‘message’ => $e->getMessage()], 500);
}
}

|