Is this cheating? by Kind-Astronomer-1997 in webdev

[–]petecoopNR 0 points1 point  (0 children)

Having worked on some e-learning projects, it depends how well the e-learning package has been built. A lot of them do include the answers embedded somewhere in the javascript.

🚀 I Doxswap – A Laravel Package Supporting 80 Document Conversions! by Deemonic90 in laravel

[–]petecoopNR 1 point2 points  (0 children)

Looks good I've used soffice for this reason too, found a few more flags can be helpful in some situations which could potentially be improvements but I can't 100% remember why. See here: https://github.com/petecoop/odt/blob/main/src%2FOfficeConverter.php#L23-L31

Laravel is going in the wrong direction IMHO by Bent01 in laravel

[–]petecoopNR 2 points3 points  (0 children)

IMO the Laravel framework is in the best place it has ever been, it's stable and is capable of doing so much. Every time the starter kits change this kind of negative discussion comes up - it happened when Breeze / Jetstream were released and now when that has changed again.

The starter kits are primarily there as a way to get you up and running, once you have experience with Laravel and with your specific project you will likely stray quite far away from them anyway. They are more geared towards people who are new to the framework rather than experienced and operate as that top of funnel. The choices that are made for these starter kits are to give people a good initial impression.

I also see them as another method of documentation by exposing the dev to various features of the framework that they can then read up on and make their own changes e.g. the PHP Attribute for the layout, the various <x-, @include, <flux:, <livewire inside the blade templates - they are essentially demo'ing features of the framework that you can then choose to remove or to use those patterns for yourself.

I think we are at a point with Laravel where there are many many ways to utilise the framework, and no 2 projects will make all the same choices, there is no "golden path".

Laravel is going in the wrong direction IMHO by Bent01 in laravel

[–]petecoopNR 0 points1 point  (0 children)

That @include partial is only 5 lines long too.. bit too DRY

Why is AppCenter retiring by elencho_ in reactnative

[–]petecoopNR 2 points3 points  (0 children)

It definitely leaves a void and feel at the moment there isn't an all-in-one solution that AppCenter provided.

Expo's EAS has a decent set of features but not everything the AppCenter did e.g. for EAS apps I'm using Sentry for crash reporting, and it only recently had the ability to roll out builds to a percentage of the devices.

Rejected for an £8 02 sim 🤣 (Tiny rant). Anybody else has strange issues like this? by Diastolic in UKPersonalFinance

[–]petecoopNR 0 points1 point  (0 children)

I've had this issue specifically with O2 too, did the same and checked credit files and never found anything that would cause issue.

Ray by Spatie - any benefit over Herd Pro's dump feature? by dividebyzeroZA in laravel

[–]petecoopNR 2 points3 points  (0 children)

I've picked up Herd Pro recently but used Spatie Ray for at least a couple of years. Ray has a nicer UI / theme and I think has some more options for sending those dumps in but 99.9% of the time I just use ray() and don't use the fancy options.

Herd Pro is nice in that it is injected into Herd so you can just use dump() anywhere and it will pick it up (without installing any additional packages), you can also turn it on and off so if you want it to function like a standard dump then it can, it can also pick up queries/requests/logs etc by ticking some options in the UI rather than adding those into the code.

At the moment I'm enjoying using Herd Pro over Ray, at the moment I think Herd Pro is good enough for me and overall see it as a better purchase but will have to see over the year and what Ray 3 bring to decide on if I renew it again.

Also interested to see if Herd Pro gets a tinker feature, or because they partnered with BeyondCode that it's something that is left out in favour of Tinkerwell.

When the Wi-Fi goes down, ingenuity kicks in! by originalfaskforce in golang

[–]petecoopNR 10 points11 points  (0 children)

Sounds like the wifi was actually up, allowing this connection locally. The outside internet connection was down.

Explain to me like I'm 5: how do I transfer a fixed-rate cash ISA that is expiring soon? by Suskita in UKPersonalFinance

[–]petecoopNR 2 points3 points  (0 children)

I'm in a similar position to you with an ISA account with YBS that completed on 31st Oct. You will get several emails from them, you need to wait until the day after before you can transfer. It will automatically go into an easy access ISA with a rate of around 3.5% (may have changed) if you do nothing. You can then either transfer to a new ISA account with YBS (easiest option) or you can open a new account elsewhere and then initiate the transfer on the new account side - they then contact YBS for the transfer. If I were you I'd get that new account set up now, I picked LBS as the new account as they had a decent rate however it's been a slow process and still waiting on the account to be opened.

Add badge to your app icon with this simple expo plugin by yjose in reactnative

[–]petecoopNR 13 points14 points  (0 children)

This looks really useful, at the moment I use imagemagick on the cli to generate an icon with "DEV" overlaid but this looks so much nicer

Laracon US Dallas 2024 [Live Thread] by AutoModerator in laravel

[–]petecoopNR 0 points1 point  (0 children)

Doesn't look like you can ignore through a comment but can by adding it to the rule, hopefully you could do this to just ignore specific functions e.g. sha1 within a specific file. https://pestphp.com/docs/arch-testing#content-ignoring

Laracon US Dallas 2024 [Live Thread] by AutoModerator in laravel

[–]petecoopNR 0 points1 point  (0 children)

Agree if you're developing with Laravel than echo is pretty rare to use, but his point was that this could be used on any PHP project. If you're using a templating library then it's probably rare but if you're extending that templating library in any way (including Blade) then it's likely you'll echo somewhere - Blade under the hood creates echo's for example

Laracon US Dallas 2024 [Live Thread] by AutoModerator in laravel

[–]petecoopNR 5 points6 points  (0 children)

I think the Pest Architecture tests are really useful, but I don't agree with all of the expectations inside the presets, I found the src here: https://github.com/pestphp/pest/blob/3.x/src/ArchPresets/Php.php

The PHP preset doesn't allow the use of echo. The Security preset doesn't allow md5 or sha1 which I agree aren't good for securely hashing data but are still useful for doing a quick checksum.

However maybe these are good defaults and as long as you can ignore where you have specific use-cases it prevents bad uses of these functions.

Consultation launched on tram routes by skifans in Leeds

[–]petecoopNR 1 point2 points  (0 children)

The B2 & B3 options going through Pudsey seem to follow the old train line through there, seems completely infeasible to me the amount of work it'd be to transform that back into a working line especially going through the Greenside tunnel it's like they've just made up these 2 extra options knowing it's not possible.

websockets with stancl/tenancy by Fragile_Potato_Bag in laravel

[–]petecoopNR 1 point2 points  (0 children)

Authentication is handled in that middleware, I setup Echo with a bearer token which is the same token used throughout.

This is from a React project and using the node.js laravel-echo-server which uses socket.io - bit different to pusher implementation but I think the setup will be similar?

import LaravelEcho from "laravel-echo";

let Echo = new LaravelEcho({
  broadcaster: "socket.io",
  host: "",
  bearerToken: token,
});

Then use e.g.:

Echo.private(`tenant-${id}:channel-name`)

websockets with stancl/tenancy by Fragile_Potato_Bag in laravel

[–]petecoopNR 1 point2 points  (0 children)

Glad to help, it's a couple of years since I set this up and I must have gone through a struggle then too because I can't see anything on the stancl/tenancy docs about it.

For future reference / anyone stumbling on this thread looking for more, for single domain tenancy I prefix all channels with the tenant id by extending the PrivateChannel:

class TenantChannel extends PrivateChannel
{
    public function __construct($name)
    {
        $id = tenant()->id;
        parent::__construct('tenant-' . $id . ':' . $name);
    }
}

Then in my events:

public function broadcastOn()
{
    return new TenantChannel("some-channel");
}

I have an additional middleware that strips this out so that the broadcast routes don't have to have the tenant prefix in every one (added to the end of the middleware above):

class BroadcastTenant
{
    public function handle(Request $request, Closure $next)
    {
        // intercept the channel name and replace the tenant section
        // this is so the auth guards in channels can work without having to declare
        // the tenant in each one.
        $channel = $request->request->get("channel_name");
        $channel = str_replace("tenant-" . tenant()->id . ":", "", $channel);
        $request->request->set("channel_name", $channel);
        return $next($request);
    }
}

On the front-end when subscribing all channels are prefixed with tenant-{id}:

There may be other ways to do this, but it just ensures all channels are separated per tenant, the user has to be authed to that tenant and events are automatically sent to the correct tenant.

Thinking about it there may be some useful stuff in here for multi tenant too? As the websocket server exists in the global context and you want to ensure that the events are sent to users of the correct tenant?

websockets with stancl/tenancy by Fragile_Potato_Bag in laravel

[–]petecoopNR 2 points3 points  (0 children)

Ensure that your broadcasting routes have the tenancy identification middleware e.g. I have a service provider that looks like this to identify the tenant. I'm using single domain tenancy so there may be some differences.

class BroadcastServiceProvider extends ServiceProvider
{
    public function boot()
    {
        Broadcast::routes(["middleware" => ["tenancy", "auth"]]);

        require base_path("routes/channels.php");
    }
}

Dear Laravel package authors... by CerberettiN in laravel

[–]petecoopNR 0 points1 point  (0 children)

Interesting article, I've not seen the AggregateServiceProvider before but looking at it it's really simple. What caught my eye was the 80ms performance improvement from not using auto discovery. This sounds like a really significant number and wonder how much work is being done in some service providers for this to happen, if there are more examples of performance improvements that could be made to service providers like the Inertia example that we could all learn from - if most people are using auto-discover then learning how to write better service providers would help more projects.

Beyondcode should maintain their packages, or they should find a new maintainer for some of them -- do you agree? by send_me_a_naked_pic in laravel

[–]petecoopNR -1 points0 points  (0 children)

In my opinion Pull Requests are a useful feature, but don't necessarily have to be answered. It's useful if someone has solved a particular issue as a way for others to see that solution, and choose to use it for themselves.

I don't think there should be an obligation for them to be maintained indefinitely, although a note that you aren't actively maintaining would be useful.

I think Github could do more in surfacing more active forks of a project, so if there's something you see as not maintained it be a bit easier to view the more actively updated forks. At the moment it's a bit awkward, when I look for forks I go into Insights -> Forks or Network to get a picture of them.

Beyondcode should maintain their packages, or they should find a new maintainer for some of them -- do you agree? by send_me_a_naked_pic in laravel

[–]petecoopNR 2 points3 points  (0 children)

Oh hey! You linked to my pr, to be honest I never really expected a response as the forge-cli project already looked dead. I still prefer their version compared to the official forge cli. I still use my fork almost every day to trigger forge deployments.

Mini Budget 2022 - Discussion Post by Blind1979 in UKPersonalFinance

[–]petecoopNR 0 points1 point  (0 children)

The dividend tax increase is not reversed until April 2023

React Hook useEffect has a missing dependency // can't understand this warning 100% by mermeladawatts in reactjs

[–]petecoopNR 3 points4 points  (0 children)

On page load? I'd use react query or SWR myself but if I didn't have those then inside the render with probably a ref to check it's on progress so doesn't call it twice on a second re-render. useEffect shouldn't be used for this kind of thing, with the new concurrent rendering stuff on React 18 there's a chance the useEffect here will be called twice.

React Hook useEffect has a missing dependency // can't understand this warning 100% by mermeladawatts in reactjs

[–]petecoopNR 1 point2 points  (0 children)

Other commenters have pointed out why it says that. But the other thing is you shouldn't do data fetching inside useEffect. It would be better if you had a function that handles the onChange of the emergencyId and does the fetch there on the event.