frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Trying to make an Automated Ecologist: A first pass through the Biotime dataset

https://chillphysicsenjoyer.substack.com/p/trying-to-make-an-automated-ecologist
1•crescit_eundo•23s ago•0 comments

Watch Ukraine's Minigun-Firing, Drone-Hunting Turboprop in Action

https://www.twz.com/air/watch-ukraines-minigun-firing-drone-hunting-turboprop-in-action
1•breve•1m ago•0 comments

Free Trial: AI Interviewer

https://ai-interviewer.nuvoice.ai/
1•sijain2•1m ago•0 comments

FDA Intends to Take Action Against Non-FDA-Approved GLP-1 Drugs

https://www.fda.gov/news-events/press-announcements/fda-intends-take-action-against-non-fda-appro...
1•randycupertino•2m ago•0 comments

Supernote e-ink devices for writing like paper

https://supernote.eu/choose-your-product/
1•janandonly•4m ago•0 comments

We are QA Engineers now

https://serce.me/posts/2026-02-05-we-are-qa-engineers-now
1•SerCe•5m ago•0 comments

Show HN: Measuring how AI agent teams improve issue resolution on SWE-Verified

https://arxiv.org/abs/2602.01465
2•NBenkovich•5m ago•0 comments

Adversarial Reasoning: Multiagent World Models for Closing the Simulation Gap

https://www.latent.space/p/adversarial-reasoning
1•swyx•5m ago•0 comments

Show HN: Poddley.com – Follow people, not podcasts

https://poddley.com/guests/ana-kasparian/episodes
1•onesandofgrain•14m ago•0 comments

Layoffs Surge 118% in January – The Highest Since 2009

https://www.cnbc.com/2026/02/05/layoff-and-hiring-announcements-hit-their-worst-january-levels-si...
7•karakoram•14m ago•0 comments

Papyrus 114: Homer's Iliad

https://p114.homemade.systems/
1•mwenge•14m ago•1 comments

DicePit – Real-time multiplayer Knucklebones in the browser

https://dicepit.pages.dev/
1•r1z4•14m ago•1 comments

Turn-Based Structural Triggers: Prompt-Free Backdoors in Multi-Turn LLMs

https://arxiv.org/abs/2601.14340
2•PaulHoule•15m ago•0 comments

Show HN: AI Agent Tool That Keeps You in the Loop

https://github.com/dshearer/misatay
2•dshearer•17m ago•0 comments

Why Every R Package Wrapping External Tools Needs a Sitrep() Function

https://drmowinckels.io/blog/2026/sitrep-functions/
1•todsacerdoti•17m ago•0 comments

Achieving Ultra-Fast AI Chat Widgets

https://www.cjroth.com/blog/2026-02-06-chat-widgets
1•thoughtfulchris•19m ago•0 comments

Show HN: Runtime Fence – Kill switch for AI agents

https://github.com/RunTimeAdmin/ai-agent-killswitch
1•ccie14019•22m ago•1 comments

Researchers surprised by the brain benefits of cannabis usage in adults over 40

https://nypost.com/2026/02/07/health/cannabis-may-benefit-aging-brains-study-finds/
1•SirLJ•23m ago•0 comments

Peter Thiel warns the Antichrist, apocalypse linked to the 'end of modernity'

https://fortune.com/2026/02/04/peter-thiel-antichrist-greta-thunberg-end-of-modernity-billionaires/
3•randycupertino•24m ago•2 comments

USS Preble Used Helios Laser to Zap Four Drones in Expanding Testing

https://www.twz.com/sea/uss-preble-used-helios-laser-to-zap-four-drones-in-expanding-testing
3•breve•29m ago•0 comments

Show HN: Animated beach scene, made with CSS

https://ahmed-machine.github.io/beach-scene/
1•ahmedoo•30m ago•0 comments

An update on unredacting select Epstein files – DBC12.pdf liberated

https://neosmart.net/blog/efta00400459-has-been-cracked-dbc12-pdf-liberated/
3•ks2048•30m ago•0 comments

Was going to share my work

1•hiddenarchitect•33m ago•0 comments

Pitchfork: A devilishly good process manager for developers

https://pitchfork.jdx.dev/
1•ahamez•34m ago•0 comments

You Are Here

https://brooker.co.za/blog/2026/02/07/you-are-here.html
3•mltvc•38m ago•1 comments

Why social apps need to become proactive, not reactive

https://www.heyflare.app/blog/from-reactive-to-proactive-how-ai-agents-will-reshape-social-apps
1•JoanMDuarte•38m ago•1 comments

How patient are AI scrapers, anyway? – Random Thoughts

https://lars.ingebrigtsen.no/2026/02/07/how-patient-are-ai-scrapers-anyway/
1•samtrack2019•39m ago•0 comments

Vouch: A contributor trust management system

https://github.com/mitchellh/vouch
3•SchwKatze•39m ago•0 comments

I built a terminal monitoring app and custom firmware for a clock with Claude

https://duggan.ie/posts/i-built-a-terminal-monitoring-app-and-custom-firmware-for-a-desktop-clock...
1•duggan•40m ago•0 comments

Tiny C Compiler

https://bellard.org/tcc/
6•guerrilla•41m ago•1 comments
Open in hackernews

Can someone review my Laravel code?

4•junebuggerz•5mo ago
I have a question on code review stack exchange and haven't gotten an answer yet. I am trying to get an answer to my question on there. The link to the question is https://codereview.stackexchange.com/questions/297943/product-service-class-and-product-controller-class-for-an-e-commerce-website

I just want to know if the code is good enough to show to hiring recruiters for an entry level Jr Laravel developer role. Please if someone can read the question on there and either leave me a answer on there or here.

Comments

lzyuan1006•5mo ago
Can we leave it to Claude Code to do this?
junebuggerz•5mo ago
What do you mean? Claude Code can code review?
moomoo11•5mo ago
Yeah. You can ask it to give you a code review.

If you want to know what to ask I’d recommend telling it you want to ensure your code is clean, single responsibility, extensible, and testable.

I think when you work with these big frameworks the more important thing as a junior imo would be to make sure you understand the underlying tech (db, network basics, etc) and the latest framework conventions. Just keep it simple.

junebuggerz•5mo ago
I mean I guess I can do that, but I would prefer an actual "professional" web developer to give me advice, I mean I want to know if my code is good enough to "start" applying for jobs, and getting a code review from Claude Code would be nice if I already had a job, you know?
moomoo11•5mo ago
Right but I'm telling you that you're worrying about the wrong thing, if that makes sense.

The truth is that engineering is very opinionated, and you've picked an opinionated framework.

I don't know php/laravel, but I've worked on Rails/Elixir/etc frameworks. Having interviewed juniors in technical rounds, I'm telling you that the more important thing for you (I take it you're a fresh junior?) is to understand the framework's conventions and be able to navigate that well enough. Can you code in php? Once you're on the job, you'll find that those conventions tend to go out the door when there's actual money on the line, so the best you can do is be aware and on top of it.

Also, to be honest, without knowing php/laravel, the best I can do while I'm on my phone (take it or leave it, or use Claude/AI - I am self taught and nobody code reviewed me when I started)

- Return custom errors instead of strings. Like NotFoundError, ForbiddenError, etc. This way you have some consistency, and you can include like code, message or whatever fields for better API user experience

- If there are no Products, just return an empty list instead of a string like "No products found"

- When you delete you can just return the ID or even nothing (just a 200 OK)

- Use proper http codes. I'm not sure if laravel handles that automatically, or you need to do like 201 for create, for example.

Anyway good luck man, if you're new you're in for a world of wonder :-)

Also try any Php/Laravel Slack/Discord communities too. They will be more helpful!

junebuggerz•5mo ago
Okay everything you told me lined up with what Gemini told me when I asked for a code review and gave it my code. So thank you for the advice! This totally helped me out. After I fixed all the errors (I will post the code here that I fixed) it said the code was more than ready to be a jr developer, so I guess I am going to finish my project and start applying for jobs and see what HR managers tell me... and thank you for the good luck :)
junebuggerz•5mo ago
I know you don't know Laravel, but this is what I changed and told me I did a good job now, with some minor tweaks that need to be done like Laravel Form Requests for form validation

<?php

namespace App\Services;

use App\Models\Product; use App\Models\Category; use Illuminate\Database\Eloquent\ModelNotFoundException; use Illuminate\Database\Eloquent\Collection;

class ProductService {

    public function store(array $data, string $category_id): Product {

        $product_to_save = new Product([
            'name' => $data['name'],
            'slug' => $data['slug'],
            'description' => $data['description'],
            'price' => $data['price'],
            'sku' => $data['sku'],
            'stock_quantity' => $data['stock_quantity'],
        ]);

        $category = Category::findOrFail($category_id);
        $product = $category->products()->save($product_to_save);
        
        return $product;

    }

    public function getProductsByCategory(string $category_name): Collection {

        $category = Category::where('name', $category_name)->firstOrFail();
        return $category->products()->with('category')->get();

    }

    public function detail(string $id): Product {

        $product = Product::findOrFail($id);
        
        return $product;

    }

    public function index(): Collection {

        $product = Product::all();

        if ($product->isEmpty()) {
            throw (new ModelNotFoundException)->setModel(Product::class);
        }

        return $product;

    }

    public function delete(string $id){

        $product = Product::findOrFail($id);
        
        $product->delete();

        return $product;

    }

    public function checkStock(string $id): Boolean {
        $in_stock = null;

        $product = Product::findOfFail($id);
        $product_stock = $product->stock_quantity;

        if($product_stock > 0){
            $in_stock = true;
        }

        if($product_stock == 0){
            $in_stock = false;
        }

        return $in_stock;

    }

    public function updateProductStock(string $id, int $amount): Boolean {

        $product = Product::findOrFail($id);

        if($amount < 0) {

            return false;

        } else {

            $product->stock_quantity = $amount;
            $product->save();

            return true;

        }

    }

    public function applyDiscount(string $id, float $percentage): Boolean {

        $product = Product::findOrFail($id);

        if ($percentage <= 0 || $percentage > 100) {

            return false;

        }

        $discount_amount = $product->price * ($percentage / 100);
        $new_price = $product->price - $discount_amount;

        $product->price = max(0, $new_price);
        $product->save();

        return true;
    }

    public function makeProductFeatured(string $id): Boolean {

        $product = Product::findOrFail($id);

        $product->is_featured = true;
        $product->save();

        return true;

    }

    public function getAllFeaturedProducts(): Collection {

        $featured_products = Product::where('is_featured', true)->with('category')->get();

        return $featured_products;

    }
}

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request; use App\Services\ProductService; use Illuminate\Http\JsonResponse;

class ProductController extends Controller { //

    public function __construct(ProductService $productService) {
        
        $this->productService = $productService;
    
    }
    
    public function store(Request $request): JsonResponse {

        $category_id = $request->category_id;

        $validated_data = $request->validate([
            'name' => 'required|string|max:255',
            'slug' => 'required|string|max:255',
            'description' => 'required|string|max:255',
            'price' => 'required|numeric',
            'sku' => 'required|string|max:255',
            'stock_quantity' => 'required|numeric',
        ]);

        //$path = $request->file('image')->store('images', 'public');
        
        $product = $this->productService->store($validated_data, $category_id);
            return response()->json([
                'product' => $product,
            ]);
    }

    public function getProductsByCategory(string $category_name): JsonResponse {

        $product = $this->productService->getProductsByCategory($category_name);
        return response()->json([
            'products' => $product,
        ]);

    }

    public function index(): JsonResponse {

        $product = $this->productService->index();

        return response()->json([
            'products' => $product,
        ]);

    }

    public function detail(string $id): JsonResponse {

        $product = $this->productService->detail($id);
        return response()->json([
            'product' => $product,
        ]);

    }

    public function delete(string $id): JsonResponse {

        $product = $this->productService->delete($id);
        return response()->json([
            'product' => $product,
        ]);

    }
}

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\HasMany;

class Product extends Model { // use SoftDeletes;

    protected $fillable = [
        'category_id',
        'name',
        'slug',
        'description',
        'short_description',
        'price',
        'compare_at_price',
        'sku',
        'stock_quantity',
        'is_featured',
        'is_active',
        'weight',
        'dimensions',
    ];

    public function category(): BelongsTo
    {
        return $this->belongsTo(Category::class);
    }

    public function product_images(): HasMany
    {
        return $this->hasMany(ProductImage::class);
    }

    public function reviews(): HasMany
    {
        return $this->hasMany(Review::class);
    }

    public function productskus(): HasMany
    {
        return $this->hasMany(ProductSku::class);
    }

    public function tags(): BelongsToMany
    {
        return $this->belongsToMany(Tag::class);
    }
    
}

This compared to the code from code review stack overflow is a major changer I guess... Like I said everything you said and more lined up pretty clearly, of course there is always room for making the code better, but it's a start I guess...

TheCapeGreek•5mo ago
I think neither StackExchange nor HackerNews are probably the right place where you'll find help with this. I'm sure there are plenty of Laravel peeps lurking around here, but HN's format isn't great for code review.

Find dedicated Laravel communities like Laracasts, Larachat Slack, the official Laravel Discord, your local tech community group's #laravel or #php channel.

To your question: Will this code get you a job? No, it's a super basic example. You seem to know that demonstrating more advanced concepts will do you good.

Basically, a snippet of code isn't enough to get you hired. Yes, you've done the absolute basics of MVC with Laravel, and split logic out into a Service class which can be handy.

What you need to do is put the entire project on your Github. Use everything you're learning in the app. Then, make sure the readme is up to date with what the project does, and add some screenshots or a recording to the readme of how it works. You don't have to build the next Amazon, but a basic "fake" e-commerce app and similar is good enough to demonstrate what you're doing.

Make sure you commit code frequently and logically (commit groups of code by the feature you've added), so that your progress can be seen. Otherwise it can also look like to just copied and pasted code into the repo.

All that being said, the sample you've built is decent for junior work! If you want to keep levelling up, I recommend Laracasts (plenty of free content on the site and Youtube channel) and Laravel Daily to start with.

The other poster is right that understanding the fundamentals of your tech is arguably more important than learning a framework, but at this stage in your career I think it's more of a tomato tomato thing. You can start with a framework to be productive and then learn more about the fundamentals over time as you need to. Don't get bogged down in building a perfect understanding of PHP and associated technologies if it's resulting in you not getting anything built.

junebuggerz•5mo ago
Yes I plan to keep leveling up for sure. And plan to finish the project, it will be a backend api to a E-Commerce website using Laravel, of course, I am planning on becoming a Backend Developer. And I plan to add Events\Listeners, Queues, Cache, 3rd Party Integrations(maybe PayPal), and maybe add some DevOps stuff using Jenkins(PHP unit, SonarQube, Code coverage for PHP), Ansible, etc... And I know there is a lot to learn, but if I do add all that (what I wrote up above) and finish the project, then can it be worthy of me getting a job, is that what you are saying, if I FINSIH the project of that level and maybe 2 more, I would be ready to start applying for Jr Laravel Developer Roles? But at least you say this is junior work. That made me feel like all this work I have put into web development has finally paid off. And yes I know what you are saying also of understanding the fundamentals first, and about making a up to date readme, adding screen shots of how it works, commit code on github, and uploading my code to github, and keep leveling up :) Thank you for your feedback!
TheCapeGreek•5mo ago
Worry about working with Laravel, PHP, and probably a database first. Worry about DevOps in a year or two.

You don't need a 100% complete project to get hired, but you definitely need more than a few models and a controller. E-commerce can be a big thing to bite off, so try and define a concrete (and simple!) scope of what your app should be doing.

Bonus points if you get some tests written in there too.

Otherwise, applying for jobs right now in the junior area is quite the crapshoot. It's a volume game, so you might as well start applying for any and every junior role you see. It might not even be Laravel/PHP related.

junebuggerz•5mo ago
Okay! Thank you for you for your advice and guidance! It really helped me out a lot. I will start applying for jobs now once I have a bit more code to add to my project :)
obayesshelton•5mo ago
Try Laracasts forum

Or Twitter

Or Reddit

junebuggerz•5mo ago
Okay I will definitely check those out