1 Cannot Log Into Forge SSH
So after quite some time, it turned out to be Sequel Pro. Uninstalled it and downloaded a new version and all worked ok.
Started a new conversation Cannot Log Into Forge SSH
I have a database server on a Digital Ocean server that holds all my databases but I had to reinstall osx and after Installing Sequel Pro I cannot access the DB server. I've checked and double-checked the details and all are exactly the same as my details on the MacBook. The only thing different will be the SSH keys. I created new keys on the iMac but if I add the key to Forge and try to log in I get
Unable to connect to host 00.00.00.00, or the request timed out. Be sure that the address is correct and that you have the necessary privileges, or try increasing the connection timeout (currently 10 seconds). MySQL said: SSL connection error: Server doesn't support SSL
If i play around then i get::
The SSH Tunnel could not authenticate with the remote host. Please check your password and ensure you still have access.
Now i know the password is correct as i can login to the server through SSH and also connect to the db using the same details.
I just can't understand why it works on my MacBook and not on the iMac with exactly the same settings...
Any help or ideas would be massively grateful.
Thank you
Started a new conversation Foreach Radio Items
Hi. I'm not particularly good with javascript but bumble through slowly.
What I'm trying to do is to have a selection of radio buttons under a foreach loop of images. So image 1,2,3, etc. Under the images is a form with a selection of radio buttons that lets the user choose what they want to do with that image (delete, destroy, scan etc.) and a submit under each of the images that pop up when they select an option.
The easy part for me was displaying the images and building the form but now after a fair bit of hair pulling I'm struggling on the JS part. I can get it all to work on 1 image and I've also got the code working to differentiate between the images, but how do I get it so the javascript knows which image to work on. I.e. if I select "delete" on image 2, I want it to display the message and the submit button for that and not the others. Hope that makes sense. Heres what I have so far.
<div class="grid_4 omega"> <div class="cont"> @if($scan->scan_paths == "images/viewer-demo.jpg") <img src="{{ url($scan->scan_paths) }}" alt="Avatar" class="image" style="width:100%"> <a href="{{ route('customer.scan-viewer.show', ['scan' => $scan->id]) }}"> <div class="middle"> <div class="text">VIEW</div> </div> </a> @else <img src="{{ config('settings.s3.url') . $scan->scan_paths }}" alt="{{ str_replace('.jpg', '', str_replace('customers/' . Auth::user()->username . '/scans/', '', $scan->scan_paths)) }}" class="image" style="width:100%"> <a href="{{ route('customer.scan-viewer.show', ['scan' => $scan->id]) }}"> <div class="middle"> <div class="text">VIEW</div> </div> </a> @endif </div> <p> Uploaded {{ $scan->created_at->format('dS F Y') }} <br> <span style="color:grey;">Image Ref: {{ str_replace('.jpg', '', str_replace('customers/' . Auth::user()->username . '/scans/', '', $scan->scan_paths)) }}</span> </p> <form action="{{ route('customer.scan-viewer.update', ['id' => $scan->id]) }}" role="form" method="POST"> @csrf @if($scan->destroy_item == 0) <p> <input type="radio" name="scan_selection" id="toggle-scan-{{ $scan->id }}" value="1"> SCAN ALL PAGE <br> <input type="radio" name="scan_selection" id="toggle-forward-{{ $scan->id }}" value="2"> FORWARD THIS MAIL ITEM <br> <input type="radio" name="scan_selection" id="toggle-delete-{{ $scan->id }}" value="3"> DELETE IMAGE FROM VIEWER <br> <input type="radio" name="scan_selection" id="toggle-destroy-{{ $scan->id }}" value="4"> DESTROY THIS MAIL ITEM <br> </p> @else <p> <input type="radio" name="scan_selection" id="toggle-delete-{{ $scan->id }}" value="3"> DELETE IMAGE FROM VIEWER </p> @endif <div id="show-scan-{{ $scan->id }}" style="display:none; line-height: 1em;"> <p> <small class=""> Selecting "SCAN ALL PAGES" will scan all the pages in this mail item. </small> </p> <p> <input type="submit" id="submit_scan-{{ $scan->id }}" value="SUBMIT & REFRESH"> </p> </div> <div id="show-forward-{{ $scan->id }}" style="display:none; line-height: 1em;"> <p> <small class=""> Selecting "FORWARD THIS MAIL ITEM" will send this mail item to you via your selected forwarding method. </small> </p> <p> <input type="submit" id="submit_forwarding-{{ $scan->id }}" value="SUBMIT & REFRESH"> </p> </div> <div id="show-delete-{{ $scan->id }}" style="display:none; line-height: 1em;"> <p> <small class="error"> Selecting "DELETE IMAGE FROM VIEWER" will delete the selected scan and you will no longer be able to DESTROY the original mail item. </small> </p> <p> <input type="checkbox" id="confirm_delete-{{ $scan->id }}" name="confirm_delete"> Are you sure? </p> <p> <input type="submit" id="submit_delete-{{ $scan->id }}" value="SUBMIT & REFRESH"> </p> </div> <div id="show-destroy-{{ $scan->id }}" style="display:none; line-height: 1em;"> <p> <small class="error"> Selecting "DESTROY THIS MAIL ITEM" will notify the mailroom to DESTROY the physical mail item. </small> </p> <p> <input type="checkbox" id="confirm_destroy-{{ $scan->id }}" name="confirm_destroy"> Are you sure? </p> <p> <input type="submit" id="submit_destroy-{{ $scan->id }}" value="SUBMIT & REFRESH"> </p> </div> </form> </div>
JS
$(document).ready(function () { $('input[type="radio"]').click(function () { // Toggle scan all if ($(this).attr('id') === 'toggle-scan-{!! $scan->id !!}') { $('#show-scan-{!! $scan->id !!}').show(); } else { $('#show-scan-{!! $scan->id !!}').hide(); } // Toggle Forwarding if ($(this).attr('id') === 'toggle-forward') { $('#show-forward').show(); } else { $('#show-forward').hide(); } if ($(this).attr('id') === 'toggle-delete') { $('#show-delete').show(); $('#submit_delete').prop('disabled', true); document.getElementById("confirm_delete").checked = false; $('#confirm_delete').change(function () { if ($(this).is(':checked')) { $('#submit_delete').prop('disabled', false); } else { $('#submit_delete').prop('disabled', true); } }); } else { $('#show-delete').hide(); $('#submit_destroy').prop('disabled', false); document.getElementById("confirm_delete").checked = false; } // Toggle destroy and delete radio if ($(this).attr('id') === 'toggle-destroy') { $('#show-destroy').show(); $('#submit_destroy').prop('disabled', true); document.getElementById("confirm_destroy").checked = false; $('#confirm_destroy').change(function () { if ($(this).is(':checked')) { $('#submit_destroy').prop('disabled', false); } else { $('#submit_destroy').prop('disabled', true); } }); } else { $('#show-destroy').hide(); $('#submit_destroy').prop('disabled', false); document.getElementById("confirm_destroy").checked = false; } }); });
Cheers
Replied to Sorting By Id
I had something like this before which worked for me
->orderByRaw('SOUNDEX(id), LENGTH(id), id asc')
Replied to AWS S3 Private Images
What I ended up doing was to build a route that shows the image via an id, and in the controller it then checks the user is authenticated and then changes the file to public from private and records it in the database. Ive then got a schedule running every minute that checks for opened images and sets any public files back to private. So basically it's setting the image as public for the user to view for 1 minute (or however long i want it to) and then setting it back to private.
$visibility = Storage::getVisibility('file.jpg'); Storage::setVisibility('file.jpg', 'public')
It's a bit of a long way of doing it, but it works for what i need at the moment. It's not getting used much, but buys me a little time till i find a better solution.
Replied to AWS S3 Private Images
Ah ok. Ill take a look into the IAM way.
Is there any other way of doing it with another service or public dir.
Started a new conversation AWS S3 Private Images
Hi. Im looking to create an app for a customer that shares files with their customers and was looking into using AWS S3.
Ive used S3 for a few different projects with images that weren't too sensitive (personal information etc), but for this one I need to make sure that only the logged in user that has permission to view the files can view them.
Ive uploaded a few test files as private but cant get them to show in the browser.
Theres obviously something im missing but what? Any help would be greatful.
Many thanks
Replied to Stripe Webhooks
Hi. Sorry forgot to mention I'm using "ultrahook" to post to the Webhooks controller. I know its hitting it as its saving to the log, just not running the Update user to database code.
Cheers
Started a new conversation Stripe Webhooks
Hi.
Im trying to get my webhooks sorted on the localhost. I can receive the Webhooks and log it into the logs but when i try to use the data, like update the user etc it doesn't do anything!
Heres one Webhook::
<?php namespace App\Http\Controllers\Webhooks; use App\Models\Common\Ledger; use App\Models\User; use Laravel\Cashier\Http\Controllers\WebhookController as CashierController; use Log; use Stripe\Stripe; use Illuminate\Http\Response; class StripeWebhooksController extends CashierController { /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function __construct() { Stripe::setApiKey(config('services.stripe.secret')); } public function handleCheckoutSessionCompleted($payload) { if ( ! $this->eventExistsOnStripe($payload['id'])) { return; } \Log::alert('checkout.session.completed'); \Log::alert(json_encode($payload['data']['object'])); // Save the customer_id to the user table $client_reference_id = json_encode($payload['data']['object']['client_reference_id']); User::where('id', $client_reference_id)->update([ 'stripe_id' => json_encode($payload['data']['object']['customer']) ]); return new Response('Payment Session Completed', 200); }
Any ideas?
Many thanks This should save the customer object to the user database. If i log the client_reference_id to the Log, it is correct and it finds the user.
Replied.
Replied); }
Replied to Upload File
Not sure if this helps or not but found this thread...
Replied
Replied!)
Am i right in saying that the
server is basically a block for that server_name? So if i use and admin.my-app.com i can pass through seperate redirects and so on.
I.e.
// Deals with non-www server { server_name my-app.com; return 301; } // Deals with www server { server_name; rewrite ^/registration.php /registration permanent; rewrite ^/login.php /login permanent; } // Deals with admin server { server_name admin.my-app.com; }
Cheers
Replied
Replied
Replied to Valet Issues
Found a solution.
It looks like apache was running in the background which I think was stopping it from loading nginx etc.
Heres a link for some troubleshooting guides.
After stopping apache and restarting valet it all worked.
Replied to This Connection Is Not Private
The only solution I can find is to use anything Firefox and then import the Valet certificate.
Replied.
Replied
Replied. :)
Replied.
Replied :)
Replied->data }} in the view when sending as a JSON object.
Replied data column::
public function saveActivity($request) { $data = json_encode([ 'type' => 'account', 'old' => [ 'telephone' => Auth::user()->details->telephone, 'email' => Auth::user()->email ], 'new' => [ 'telephone' => $request->get('telephone'), 'email' => $request->get('email') ] ]); $activity = Helpers::saveUserActivity($data); } // Result // {"type":"account","old":{"telephone":"12345678","email":"[email protected]"},"new":{"telephone":"12345678333","email":"[email protected]"}}
Replied; }
Replied to Validation Issue?
Ah ok. Strange as it works on other validation. Ill have to go back and double check that its the same as the others and not been changed ...
Cheers
Replied to Spatie Backup And Mysqldump
Replied to Spatie Backup And Mysqldump
Ye that command works perfectly. This is what's confusing me!
Replied to Spatie Backup And Mysqldump
Replied to OrderBy Not Quite How I Want It!
Ah, thank you, guys. I'll try that in a bit and report back.
Replied to OrderBy Not Quite How I Want It!
Replied to Strip .php From Url
Ok so after a lot of digging around and learning about Nginx i found a solution...
In the nginx config file i added ::
rewrite ^/registration.php /registration permanent;
This works perfectly.
Replied
Replied to Strip .php From Url
Would that go in the
server { $withoutExt = preg_replace('/\.[^.\s]{3,4}$/', '', $filename); }
EDIT!!!! Sorry just clicked!!!!
Ill give that a go... Cheers
Replied_replace('.php', '', $request->url()); return redirect($url); }
Replied to Forward Non Www To Www In Forge?
Sorry. Ive got a workaround for now...
I created a middleware to deal with the request.
public function handle($request, Closure $next) { if (str_contains($request->url(), '')) { return redirect(''); } return $next($request); }
Happy new year everyone :)
Replied to Strip .php From Url
I have a URL on some old site links that at the moment use, on the new app that should be going to so by removing the .php from the end it will return the correct url.
Replied.
Started a new conversation Forward Non Www To Www In Forge?
Hi how do i forward requests to a certain routes file to www?
Many thanks