0 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.
Earned once your experience points ranks in the top 10 of all Laracasts users.
Replied to How To Shift Laravel Project Is In V5.8 To V7.x Or V8.x?
I made some upgrades and found easier to start with a fresh Laravel and transfer files with some adaptations.
Replied to Implement A Star Rating System In Laravel
Awarded Best Reply on Frequent 504 Gateway Time-out
There are two main reasons for this error :
Replied to Collections 'remove' Method ?
Hello,
Try that :
$unique = $col1->unique();
$result = $col1->diffKeys($unique)->concat($unique->diff($col2));
Replied to Frequent 504 Gateway Time-out
There are two main reasons for this error :
Replied to Composer Install On Production Server
Hello,
I don't understand why run command in /www, don't you use a console in SSH ?
Awarded Best Reply on [SOLVED] Where Are The Route Names?
Maybe there are some resource routes in your web.php. Like this :
Route::resource('users', UserController::class);
Replied to [SOLVED] Where Are The Route Names?
Maybe there are some resource routes in your web.php. Like this :
Route::resource('users', UserController::class);
Replied to Pass An Additional Param In Anchor Href Tag
Why don't you use helpers like url or route ?
Replied to Workflow
In complement take care to have the same PHP version on both sides and maybe Composer version.
Awarded Best Reply on What Is The Proper Way To Have A BelongsToMany / HasOne Field
Looks like you need a hasMany and belongsTo relations.
Replied to Javascript : How To Get All Charachters Used In A String ?
You can use [...str]
with ES6.
Replied to What Is The Proper Way To Have A BelongsToMany / HasOne Field
Looks like you need a hasMany and belongsTo relations.
Replied to Upload Multiple Images Laravel & Dropzone
Try with $request->file('file')
I have this working code in one of my projects :
public function store(Request $request)
{
$photos = $request->file('file');
if (!is_array($photos)) {
$photos = [$photos];
}
if (!is_dir($this->photos_path)) {
mkdir($this->photos_path);
}
if (!is_dir($this->thumbs_path)) {
mkdir($this->thumbs_path);
}
for ($i = 0; $i < count($photos); $i++) {
$photo = $photos[$i];
$name = str_random(30);
$save_name = $name . '.' . $photo->getClientOriginalExtension();
Image::make($photo)
->resize(150, null, function ($constraints) {
$constraints->aspectRatio();
})
->save($this->thumbs_path . '/' . $save_name);
$photo->move($this->photos_path, $save_name);
$upload = new Upload();
$upload->filename = $save_name;
$upload->original_name = basename($photo->getClientOriginalName());
$upload->index = $request->session()->get('index');
$upload->ad_id = 0;
$upload->save();
}
}
Replied to Upload Multiple Images Laravel & Dropzone
Before your loop.
$imageNameArr = [];
foreach ($request->file as $file) {
Replied to Upload Multiple Images Laravel & Dropzone
No the problem is a scope issue, define your variable before :
$imageNameArr = [];
Replied to Upload Multiple Images Laravel & Dropzone
There is a scope issue with your variable $imageNameArr.
Replied to Upload Multiple Images Laravel & Dropzone
You have your error :
Undefined variable: imageNameArr
On line 26 of your controller
Replied to Upload Multiple Images Laravel & Dropzone
Look at error detail in browser network tab (you get it with F12)
Replied to Upload Multiple Images Laravel & Dropzone
I think you must change this line :
$request->file->move(public_path('path/image/'), $imageName);
for this one :
$file->move(public_path('path/image/'), $imageName);
Replied to Disable Validation On Get Request
Why don't you use distinct function for distinct methods ?
Replied to How To Seed Db In Pivot Table Laravel?
You also can use compact syntax like this kind (10 categories and 10 products for each one) :
factory(Category::class, 10)
->create()
->each(function ($category) {
$category->products()->createMany(
factory(Product::class, 10)->make();
);
});
Replied to Have I To Use Some Wrapper For Javascript Blocks In Laravel Blade ?
Blade is just HTML with special syntax, so for Javascript just use casual script tag.
Replied to Laravel Fortify And Paper CSS
I've had a look to breeze but I really don't like Tailwind.
On another hand I wonder why now these packages (laravel/ui and breeze) don't use Fortify.
Replied to How To Customize The Forgot Password Email?
Do you want to change only the text or also the template ?
Started a new Conversation Laravel Fortify And Paper CSS
For information I published a Github repository as Laravel 8 starting project with Fortify and Paper CSS as frontend framework.
There are all Fortify features and I added account delete.
Language default is french, just change in config.app to reverse to english.
This is the code for a french article.
Replied to Up-to-date List Of Blade Directives?
There is a good Cheat Sheet there but not sure is up to date.
Replied to Eloquent Empty Array Return. But 01 Item Is There
In Ajax mode just return the value and read it with browser tools.
Replied to Eloquent Empty Array Return. But 01 Item Is There
If you have a relation and the good foreign key use rather this code :
$courses = User::findOrFail($userId)->courses;
Awarded Best Reply on Migrate From Default Auth Scaffolding To Fortify
There is no view with Fortify so you must keep your views, but change the routes in forms, and also register your views in FortifyServiceProvider.
Remove routes and controllers because Fortify already has.
But why change ?
Replied to Migrate From Default Auth Scaffolding To Fortify
There is no view with Fortify so you must keep your views, but change the routes in forms, and also register your views in FortifyServiceProvider.
Remove routes and controllers because Fortify already has.
But why change ?
Replied to Foreign Key In Laravel 8
The correct syntax is :
$table->foreignId('user_id')
->constrained()
->onDelete('cascade');
And explications from documentation :
The foreignId method is an alias for unsignedBigInteger while the constrained method will use convention to determine the table and column name being referenced.
Replied to Jetstream
Seriously what in the World is wrong with regular plain CSS for a starting point.
What is wrong is only the fact that CSS is not that easy to master and it is much easier and faster to use a framework.
We could have the same reasoning with Javascript or PHP framework. Twenty years ago I was coding with simple PHP, vanilla Javascript, and CSS was still pretty mysterious.
Now things have changed a lot and technology is evolving at high speed and it seems that we often have to run to catch up with it.
Personally, I abandoned all JavaScript frameworks because browser APIs are quite sufficient.
I find it more difficult to do without a CSS framework but I have difficulty choosing and I never use the same one. On the other hand I often have a lot of CSS added to enhance the visual. I think in a year I will also give up CSS frameworks.
On the other hand I will keep Laravel for a long time!
Replied to Jetstream
There are three approaches:
Replied to Is It Possible To Get Some Kind Of "$this" In A Where Clause?
You must make a raw query to achieve this.
Awarded Best Reply on Eloquent One-to-Many Relationship
You are in case of Many to Many relation. Look at documentation to achieve it.
Replied to Eloquent One-to-Many Relationship
You are in case of Many to Many relation. Look at documentation to achieve it.
Awarded Best Reply on Asset("js/custom.js") Not Working
Your js is light, why don't keep it in view ?
Replied to Asset("js/custom.js") Not Working
Your code {{ route('maincat.create') }}
wont work in js file.
Replied to Javascript : Better To Use Const Or Let In Promises?
You should always use const unless you know the variable will change.
Replied to Fortify
I think must work with a rebinding. Create an App\Providers\TwoFactorAuthenticationProvider with same code than Laravel\Fortify\TwoFactorAuthenticationProvider. And in App\Providers\FortifyServiceProvider bind your new provider :
use Laravel\Fortify\Contracts\TwoFactorAuthenticationProviderContract;
use App\Providers\TwoFactorAuthenticationProvider;
...
public function register()
{
$this->app->singleton(
TwoFactorAuthenticationProviderContract::class,
TwoFactorAuthenticationProvider::class
);
}
I think now you have your generateSecretKey method in your application.