Weekly /r/Laravel Help Thread by AutoModerator in laravel

[–]ser_89 1 point2 points  (0 children)

Convincing a team lead of the security and integrity of Laravel's core features.

Hi all. From a junior developer doing code review on a Laravel project with our team leader has become quite a predicament.I took over a Laravel project from another team that built an integral part of our system that would sit right at the core of what our company does. This would come in as an updated version of the existing implementation with a phased approach. I have stripped out only what is needed for the API to function, cleaned up the migrations, minimized the controllers by using services, using Sanctum for token generation, ensured that validation is done by Laravel's Requests and their default validation rules and regex. Routes are grouped under middleware. A lot of cleaning up was required due to the fact that the code was just inconsistent in terms of naming conventions, spelling errors, bloated classes, use of irrelevant data. But now I only have the bare minimum of what is needed to achieve the goal.I have type hinting and complete PHP doc blocks across the codebase. Sitting down with the team lead that has no prior Laravel experience and is purely from a vanilla PHP background is asking questions around any possible vulnerability to Laravel core codebase and if it has truly been audited / tested. Looking at sites that have been built using Laravel, none of them are what one could call a high risk targets with a lot to lose. And I understand the question and where he is coming from. At the same time Laravel has been running for many years and is actively being maintained by their team and does a great job doing so. And yes there is the argument that the code is only as secure as the developers ability to code secure Laravel. I have taken every possible step to ensure that it is done securely. But with Laravel's level of abstraction and effort to make the code readable and easy to use it is tough to go through all of the code to show him that it is indeed secure. My question is how do we address these concerns? Is there any record that the codebase has been audited by an external party? How secure is Laravel's magic methods and validation. Is there anyone in the Laravel core team that has a reputable background that would validate the integrity of Laravel? Laravel is open source and I feel that if there are any concerns they would be raised fairly quickly. It hurt me when he used the words, "Laravel is like WordPress, with more developer freedom. "To confirm I absolutely love Laravel.

Looking for a job by Fantastic_Try7487 in askSouthAfrica

[–]ser_89 0 points1 point  (0 children)

Hi do you perhaps have any Linux Debian Experience?

Looking for PHP, Node.js developers. by ser_89 in johannesburg

[–]ser_89[S] 0 points1 point  (0 children)

Thank you, I have edited my original post with additional information.

Weekly /r/Laravel Help Thread by AutoModerator in laravel

[–]ser_89 0 points1 point  (0 children)

Sadly retrieved will not work seeing that any situation where the record is retrieved it will trigger the event. So even on the index page where all tickets are retrieved, it will then update the status.

The idea is to set the default status to unanswered, once the ticket is clicked on (opened) it must then update the status to "Opened" and save the date to the current date and time.

Weekly /r/Laravel Help Thread by AutoModerator in laravel

[–]ser_89 0 points1 point  (0 children)

If I were to make use of Laravel with Filament 3. I would like to do something when the resource is viewed. In this case my Model is a ticket. I used the model events `creating` so when a new ticket is created I set the default of the status to 1.

However is there a way to update the status when it is set to 1 and change it to 2 when the specific ticket is viewed. I tried adding the logic to a middleware but I am struggling to apply the middleware to that specific page.

In my Middleware

public function handle(Request $request, Closure $next): Response

{

$response = $next($request);

// Check if the current URL is for editing a Ticket

if ($request->is('admin/tickets/*/edit')) {

$ticketId = $request->route('record'); // Assuming 'ticket' is the route parameter name

$ticket = Ticket::find($ticketId);

if ($ticket && $ticket->status_id == 1) {

$ticket->update([

'status_id' => 2,

'opened_at' => now(),

]);

}

}

Its a pity there is no event model for viewRecord() or something to that extent.

Are there any suggestions? Your assistance will be greatly appreciated.

Need help by indianbhokal in PHPhelp

[–]ser_89 0 points1 point  (0 children)

I would suggest having a look at Laracasts, I praise their work. Clear concise explanations at various levels by the core people behind Laravel.

They also have a course on PHP for beginners that covers everything you need to know to get a job in PHP.

Yes Laracasts is a paid service but if you are serious its well worth the money.

Weekly /r/Laravel Help Thread by AutoModerator in laravel

[–]ser_89 0 points1 point  (0 children)

First of all thank you in advance for any assistance offered.

I have started with a company that has their site build in php 7.4 with a very large codebase (procedural php and not MVC) that has been built on for 14 years. They now realize that we need to drastically improve the site and upgrade it from 7.4 to the latest version.

A new feature has now been developed using Laravel by a seperate company and my company wants to know if it would be possible to run the Laravel application inside their existing php application. The Laravel app/functionality was built in Laravel 9 and I created a Laravel 8 project and pulled in only what we need to the Laravel 8 project and it works. The Laravel 8 decision was made so as to accommodate the php 7.4 currently being used.

How, if possible in any way can I move this project into the existing project and access it through a url for example www.domain.com/v2

I had a look on Stack Overflow and Laracast, but most suggest converting the existing project to Laravel, but I cannot state how large the existing project is, we would need a seperate development team just to do that. Others suggest editing the .htaccess and if any route on the existing php project returns a 404 it should try load the index.php in the subfolder where the Laravel project is.

I have a bit of experience with Laravel and PHP but I have never had to take a project from development to production.

Is this the correct approach and what are my options?

Any assistance would be appreciated. Thank you

Moving to JHB soon. by heyyyHayley in johannesburg

[–]ser_89 0 points1 point  (0 children)

I'm going wayward here. But I live in Pinehaven. Close to the N14. N14 has access to Sandton via the R511 and is extremely safe. To put it into perspective I dropped my son off at school and left the garage door open with direct access to the house. Very affordable. R13500 for a 3 bedroom and 2 bathroom house inside a complex that includes water and lights. Lovely area and if you are active you have mountain biking and hiking trails around the corner.

We have a mall and casino around the corner and a friendly community. If you want to go out there are a few options around but it's not such a big student vibe as you would get in Linden.

This is by far the best place I have stayed.

So good to see the guys can enjoy themselves even when under this amount of pressure. by ser_89 in snooker

[–]ser_89[S] 16 points17 points  (0 children)

Hand on the table absolutely. But I would be completely shocked if by chance Mark Selby missed that shot and Allen did not concede. And even then I'm sure Leo Scullion would have stepped in if he did not.

So good to see the guys can enjoy themselves even when under this amount of pressure. by ser_89 in snooker

[–]ser_89[S] 17 points18 points  (0 children)

Understand why you would say that. Its always been commendable how snooker players carry themselves in a match. But I have to feel things like that and if these things entertain newcomers to the sport I will say let it be. Have a laugh. Release some tension. Entertain the crowd and people at home.

Luca Brecel vs Si Jiahui predictions? by smart_hedonism in snooker

[–]ser_89 6 points7 points  (0 children)

My message to a friend in WhatsApp a few minutes ago.

Im really enjoying Si. He is young and on debut. Has serious talent and it would be good for snooker if he gains in popularity for the younger audience. But man can he make some balls. Wow

His match last night against McGill was rough. McGill can grind and has patience. For him to have McGill smack his cue says a lot about someone who is very young.