I’m trying to create an app for posting images to linkedin. Linkedin has an api which accepts an image url and a message, but it seems to be not the exact way to post an image since it is showing my …
Tag: laravel
Laravel Project on Pleask except homepage other routes are not working
I uploaded files of my Laravel project at Plesk server in httpdocs folder and change necessary permission. Now my homepage is working fine but other routes showing 404 server error ( see screenshot [http://prntscr.com/h54nra][1]) For checking few solutions in different forums and at stackoverflow I also tried…
Laravel Broadcast authentication
How do I authenticate an user to a channel with a custom auth method? For example, in my app I use a token auth (stored in the db for each user) for my API, passed via header and read by a custom middleware. How do I control the access with these custom auth methods for channels? How would be the
Ajax request keeps returning error function in Laravel
Good day guys. In my laravel application I’m trying to check if attendence for a particular date, subject, grade exists in my table. If so I have an if statement setup to display desire results based on what is returned. I’m making the request with ajax but it seems like ajax keeps running the err…
Laravel 5.5 autodiscovery not registering
I’m installing the spatielaravel-backup package. According to the instructions, I just need to composer require spatielaravel-backup and the package should be recognized and auto-installed. It looks like this is happening: But looking in /config/app.php there’s no mention of backup anywhere in the…
Upload image in Laravel
I try these code in controller: My Html input file: but i can’t upload. Any idea? Answer you can use storage::putFile(‘folder_name’, $request->image) this will return automatic generated filename and you can store that in your database. And make sure your have your default file system set…
Embedding Checkout on Laravel Blade
I’m trying to display an embedded checkout form from Stripe (https://stripe.com/docs/checkout). I notice that if I place the embedded code between @section(‘content’) and @endsection, it will not display the form when I click the Pay with card button. However, if I remove @section(‘con…
Get count of unique values with the column name in Laravel 5.2 Collection
I am trying to get the number of unique Brands from my Products Table with their count from a Laravel collection. I was able to do that using a specific query for the products but the reason i’m using a collection now is because i also want to get the Product Origins (Country), Conditions (Used / New) o…
Laravel: Count number of rows in a relationship
I have the following relationship: A venue has many offers A offer has many orders I have the following Eloquent model to represent this: I want to determine the total number of orders for venues with location_id = 5 using Laravel’s Eloquent model. The only way I managed to do this is as follows: Howeve…
Laravel : How to add days to datetime field?
How to add days to datetime field in Laravel? For example, there is a updated_at field in articles table: I want to add 30 days to updated_at field. In Carbon, it could be done like this: But how to do it in above example? Answer Since updated_at and created_at fields are automatically cast to an instance of …