jakyeru / imagesharing Goto Github PK
View Code? Open in Web Editor NEWLaravel project used for image hosting.
License: MIT License
Laravel project used for image hosting.
License: MIT License
ImageSharing/app/Helpers/helpers.php
Line 5 in aa38140
Not sure why you do it as a helper, and not inside of the controller directly. Took some time for me to understand what is this snowflake and why it's in a separate file :)
ImageSharing/app/Policies/ImagePolicy.php
Line 34 in aa38140
Policies should not return abort(404)
, it should return only true/false. Abort should come from controller's findOrFail
or similar.
It should be $table->foreignId('author_id')->constrained()
and I would rename the field from author
to author_id
More here: https://www.youtube.com/watch?v=-77LnBSL2Zk
According to the way how you form the filename, every filename will have only user ID and no more unique data, so it means one file per user? Maybe it's the way you want, I'm just doubting.
Shorter: Image::findOrFail($id)
Why do you have spaces before/after ->
symbol, like this? ...) -> where(...
- it's against coding standards, in my 15 years I've never seen anyone doing it :)
Maybe it's better to use Laravel core function soft-deletes? https://laravel.com/docs/8.x/eloquent#soft-deleting
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.