Member Since 2 Years Ago
4,550 experience to go until the next level!
In case you were wondering, you earn Laracasts experience when you:
Earned once you have completed your first Laracasts lesson.
Earned once you have earned your first 1000 experience points.
Earned when you have been with Laracasts for 1 year.
Earned when you have been with Laracasts for 2 years.
Earned when you have been with Laracasts for 3 years.
Earned when you have been with Laracasts for 4 years.
Earned when you have been with Laracasts for 5 years.
Earned when at least one Laracasts series has been fully completed.
Earned after your first post on the Laracasts forum.
Earned once 100 Laracasts lessons have been completed.
Earned once you receive your first "Best Reply" award on the Laracasts forum.
Earned if you are a paying Laracasts subscriber.
Earned if you have a lifetime subscription to Laracasts.
Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.
Earned once you have achieved 500 forum replies.
Earned once your experience points passes 100,000.
Earned once your experience points hits 10,000.
Earned once 1000 Laracasts lessons have been completed.
Earned once your "Best Reply" award count is 100 or more.
Earned once your experience points passes 1 million.
Earned once your experience points ranks in the top 50 of all Laracasts users.
Are you saying I should use a datetime format and place the date in like it would be read (08/13/2019)? I've been giving both the fields a string format.
Thanks for the laugh and info. Yup, I’m that guy in the cartoon. LOL
I see your point about not having both. I’ve actually done it with just the timestamp, but there were many times I’ve had to look at raw table data, and seeing a readable date in that case was helpful.
I would like to get opinions of the method I have used in the past for dates. In addition I would like thoughts I how I might do this better.
Usually in my DB table I will have to columns for a date. For example, if it is a start date the columns might be “start_date” (08/13/2019) and “start_date_ts” (a strtotime timestamp).
The first is for having a readable/displayable date, while the other is used for calculating date using comparisons of greater than, less than or equal on the the timestamped version to get the results I need. This has been my go-to for a long time and works well.
I’ve looked at Carbon, but their documentation is not all that great for finding some examples that are more likely to be used than how they display it. At least that is my experience with it so far.
A lot f what I do deals with a start and end dates. Using the timestamps I can do quick calculations to find records with dates that may land on or between a certain date.
I’m a lone, self-taught developer, with no one to bounce things off of. Any advice on best practices and how to best use dates would be very much appreciated.
@goatshark Thanks for the help. I finally got it.
Changed filesystem.php default to public. Ran the php artisan storage:link and made a few code changes. Now I can access the files.
Still kinda confused on how this is working. Thanks again.
Unsure how to place code here to be seen. See http://kopy.io/krZF2
@goatshark It is a link created in the view. For example, the path saved to the DB is "/project_assets/4/heave-results.jpg"
Then I use Storage to complete the path Storage::url("app" . $asset->asset_file_path);
The link created from
I'm learning Laravel 5.3 as I work on a project. I am stuck on some things and was hoping for guidance.
The idea: Each entry is a project. Admin user uploads a file or set of files associated with a project Normal users can click a link from the list of file(s) to download and view
When I created the upload I used Storage::makeDirectory(PATH_TO_FILE) to create the location for the file and storeAs(PATH, FILENAME) to place the file to that location. The path, in this case is '/project_assets/ID/FILENAME' The file is then saved to '/storage/app/project_assets/ID/FILENAME'
Now I need to access this file from a page that a normal user can access. However I get an error when I try to do this - NotFoundHttpException in RouteCollection.php line 161:
As I mentioned above, I am learning as I go, and may have gone about this the wrong way.
Any guidance is appreciated.