m7vm7v

m7vm7v

Developer at Manchester

Member Since 4 Years Ago

Liverool

Experience Points
197,080
Total
Experience

2,920 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
1702
Lessons
Completed
Best Reply Awards
35
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    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.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 40
197,080 XP
Jul
05
2 months ago
Activity icon

Awarded Best Reply on Image Based AI Or ML

You could have tags for both images and posts. If you have an image with a car on it then call the tag 'car', relate that to the posts with titles (descriptions) including 'car' OR if you go with posts with tags as well then that can do the trick.

Jun
29
2 months ago
Activity icon

Awarded Best Reply on Use Gmail For Verification In Laravel

Are you sure the creds match?

Have a look at that article and follow it - https://medium.com/graymatrix/using-gmail-smtp-server-to-send-email-in-laravel-91c0800f9662

That can be helpful too - https://stackoverflow.com/questions/42558903/expected-response-code-250-but-got-code-535-with-message-535-5-7-8-username

I am not sure if its intended but you have spaces in the from address and name

Jun
27
2 months ago
Activity icon

Replied to Internal Server Error

Do not investigate at the console tab but in network.

Find the one that fails. Click on it and then click on the response tab.

Or if you could try in postman for example might be more clear at your end.

Jun
26
2 months ago
Activity icon

Replied to How To Query Column Type In Laravel And Retrieve Boolean Values?

Then create a custom cast and do something like -

    public function get($model, $key, $value, $attributes)
    {
        if (is_bool($value)) {
            return $value ? true : false;
        }
        
        return $value;
    }

amend your logic

Activity icon

Replied to Use Gmail For Verification In Laravel

Are you sure the creds match?

Have a look at that article and follow it - https://medium.com/graymatrix/using-gmail-smtp-server-to-send-email-in-laravel-91c0800f9662

That can be helpful too - https://stackoverflow.com/questions/42558903/expected-response-code-250-but-got-code-535-with-message-535-5-7-8-username

I am not sure if its intended but you have spaces in the from address and name

Activity icon

Replied to Internal Server Error

In your log there should be a stack with timeline whats the issue.

Which laravel version do you use?

Your code can be simplified by the use of -

    public function store(Request $request)
    {
        $validatedInput = $request->validate([
            'title'      => 'required',
            'day'        => 'required',
            'start_time' => 'required',
            'end_time'   => 'required',
        ]);

        Timeslot::create($validatedInput);

        return response()->json(['success' => 'Data Added successfully.']);
    }

In your Timeslot make sure you are allowing the mass assignment properties or remove that protection by protected $guarded = [];

Make sure that you include both Request and Timeslot!!

Better help will be if we know what the log says.

Activity icon

Replied to Payment Sessions

Haven't use that one but the best place with payments in Laravel is Cashier.

That link might be also helpful - https://stackoverflow.com/questions/37856766/credit-card-paymentmaster-card-and-visa-in-laravel-5-2

Activity icon

Replied to How To Query Column Type In Laravel And Retrieve Boolean Values?

You can cast the result from the database.

    protected $casts = [
        'your_field_name' => 'boolean',
    ];

If thats not flexible enough you could create your own cast - https://laravel.com/docs/7.x/eloquent-mutators#custom-casts

Activity icon

Commented on Skeleton Loader

Great lesson!

What about a small animation like facebook does? How easy that'd be with tailwind?

Jun
23
2 months ago
Activity icon

Awarded Best Reply on Can Not Get Lang File Changes To Reflect On Prod Server

Is it the case that they are not translated as part of a queue process?

If so you have to restart the queue php artisan queue:restart

Also it might be a problem that the cache folder in production does not have the correct permissions so when you execute the php artisan cache:clear wouldn't do anything and won't spit any problems.

Have a look at - https://github.com/spatie/laravel-translation-loader/issues/44

Jun
19
3 months ago
Activity icon

Replied to Slow Terminal Commands On WLS

Checkout what I've recommended in my first post. 99% the issues will resolved.

Activity icon

Replied to Laravel Cashier - Renew, Cancel Or Resume Subscriptions

If you have the cancelled_at date correctly stored in the database then use it for checking if its active or not.

Activity icon

Replied to Update Form With Image

No worries.

Did it work at the end?

If so could you please make sure you mark as best reply the one that helped you the most?

Activity icon

Replied to Laravel Cashier - Renew, Cancel Or Resume Subscriptions

I think most of that is handled automatically for you. Usually when you cancel a subscription laravel stores an end date in the database. So for example if I subscribe today for a 30 days and cancel tomorrow then I will be having 29 more days to use my sub (thats the default situation of course).

Stripe uses webhook so if the defaults or the edge cases are not suitable for you then checkout https://github.com/spatie/laravel-stripe-webhooks

Hope that helps.

Activity icon

Replied to Separate Roles And Permissions For Each Application

If you want to proceed with the current approach I'd recommend you to use multitenancy approach -> https://divinglaravel.com/multi-tenancy-in-laravel , have a separate databases for each application so you would not have any conflicts.

Activity icon

Replied to Creating Blog Component

Try

<blog
    :props_blog_title = '{{$blog->title}}'
    :props_blog_image = '{{$blog->image}}'
    :props_blog_content = '{{$blog->content}}'
    >
</blog>

Also, in your Vue file things like {{ url(Storage::url(this.props_blog_image)) }} won't work... Add those as props aswel, Or better as a default attribute to the model.

Activity icon

Replied to Slow Terminal Commands On WLS

Install the latest PHP. Configure your php.ini file. Give it more RAM

[Recommended] Your project would only benefit if you add Homestead virtual machine as its well configured and ready to use. You will see a huge improvements with that.

Activity icon

Replied to Update Form With Image

Your thoughts are correct.

Just wrap it -

    public function update(Request $request, Model, $model)
    {
        $validatedInput = $request->validate([
	    ...
            'cover' => 'nullable|image|mimes:jpeg,png,jpg8'
        ]);

        if ($request->hasfile('cover')){
            $file = $request->file('cover');
            //save the file
            $validatedInput['cover'] = $filepath;
        }

       $model->updated($validatedInput);
   
       ...
Activity icon

Replied to Can Not Get Lang File Changes To Reflect On Prod Server

Is it the case that they are not translated as part of a queue process?

If so you have to restart the queue php artisan queue:restart

Also it might be a problem that the cache folder in production does not have the correct permissions so when you execute the php artisan cache:clear wouldn't do anything and won't spit any problems.

Have a look at - https://github.com/spatie/laravel-translation-loader/issues/44

Activity icon

Replied to Laravel Vue - V-bind Only Works If Logged In

What do you have in your controller?

I'd assume that you have a variable that you are requesting ->id but the variable is null. By the information provided I think you are requesting an $user->id but you are not logged in.

  1. Add auth middleware for the route Route::get('/...', '[email protected]')->middleware('auth')
  2. Use optional($user)->id //recommended or $userId = $user ? $user->id : false

Amend the logic, but it be more helpful is you post the controller executing that view

Jun
18
3 months ago
Activity icon

Replied to How To Increase Timeout For Sending Mail Via Smtp?

I can confirm this starts existing in the default installation of Laravel 7. The documentation does not explain how to use it and what is the expected value (or I haven't found it yet). I am not sure if in 6.x would work but I'd recommend you to try out. Add it in the array and play around with the values (install laravel 7 as a separate project to see the structure if can't figure it out). I'd assume it gets seconds or milliseconds as a value.

Jun
17
3 months ago
Activity icon

Replied to Array Field Validation

@isimelek have you tried the package? The field can be validated by -

->rules([
    'translation.*' => 'required',
])
Activity icon

Replied to PHPStorm & Laravel

@nexxai surely that can be seen in the Readme documentation of the package. If thats not enough then there are more problems to be resolved beforehand.

Jun
16
3 months ago
Activity icon

Awarded Best Reply on Video Field

This is a great place to find something specific for Laravel Nova -> https://novapackages.com/?tag=field&search=video

If thats not good enough then you'd have to create a custom field type which Nova makes simple enough -> https://nova.laravel.com/docs/3.0/customization/fields.html#fields

Activity icon

Replied to PHPStorm & Laravel

You have some options here:

  1. Go to preferences -> Plugins -> search for 'laravel' -> install it -> restart the IDE
  2. Do some additional stuffs with https://github.com/barryvdh/laravel-ide-helper
Activity icon

Replied to Algolia Index Problem

Can you provide some code? Are you using the standard laravel ID indexing? Have you used getScoutKey and getScoutKeyName in your model? Have a read at https://laravel.com/docs/7.x/scout#configuring-the-model-id Also that could be helpful https://discourse.algolia.com/t/issue-with-algolia-and-laravel/10197

Activity icon

Replied to Loading Model In An Entity

A shot it the dark but have you imported the class CommissionMember?

Activity icon

Replied to When To Decide To Use Framework

Go with whatever makes you more comfortable. At the end of the day you are the one building it! You have Laravel Nova, Laravel Voyager and many others that will bump you up quickly with the BREAD part. After that -> scalability, improvements, extending, speed are all the things you will benefit from.

Activity icon

Replied to Deploy Laraval App On Google Cloud Platform - Questions

You can use a single laravel application and a proper subdomain routing -> https://laravel.com/docs/7.x/routing#route-group-subdomain-routing

Activity icon

Replied to Array Field Validation

I'd recommend you to get additional field type for that use case such as https://novapackages.com/packages/dillingham/nova-items-field provides

Activity icon

Replied to How To Increase Timeout For Sending Mail Via Smtp?

Haven't used it before but if you open config/mail.php in your smtp array there should be an 'timeout' => null, (if not then add it). Tweak it and add a reasonable value there.

I've read some posts about complains with microsoft service and switching to mailgun or so... Consider that aswel.

Activity icon

Commented on Mobile Nav Link Component

What if we click on the menu link and then resize the window to desktop (of course that's unlikely to be a real word scenario but we all know 'never trust the user'')? I'd suspect the "X" button will remain and the mobile menu will be still there?

Jun
15
3 months ago
Activity icon

Replied to Image Based AI Or ML

You could have tags for both images and posts. If you have an image with a car on it then call the tag 'car', relate that to the posts with titles (descriptions) including 'car' OR if you go with posts with tags as well then that can do the trick.

Activity icon

Replied to Uploading Word Docs From A Mac In Laravel

What is the problem of adding the application/octet-stream to the mimetypes collection? The other option is to give some feedback to the user that a proper file exportation should be executed before uploading the file.

Activity icon

Replied to Performance Improvement In Laravel Online MCQ Test Application

You could handle all the logic in the front end. Get all the questions on a single request then collect the user's answers in the browser cache and then submit them at the end in one go.

Activity icon

Replied to Video Field

This is a great place to find something specific for Laravel Nova -> https://novapackages.com/?tag=field&search=video

If thats not good enough then you'd have to create a custom field type which Nova makes simple enough -> https://nova.laravel.com/docs/3.0/customization/fields.html#fields

Activity icon

Awarded Best Reply on Issue With Pathing Variable To Email Template

As long as they are public they should be sent to the mail blade.

try ->view('mail.index'); which will be a file with path resource/views/mail/index.blade.php

Or you could try -

                    ->view('mail.index')
                    ->with([
                        'item_status' => $this-> item_status,
                        'site' => $this-> site,
                    ]);
Activity icon

Replied to Issue With Pathing Variable To Email Template

As long as they are public they should be sent to the mail blade.

try ->view('mail.index'); which will be a file with path resource/views/mail/index.blade.php

Or you could try -

                    ->view('mail.index')
                    ->with([
                        'item_status' => $this-> item_status,
                        'site' => $this-> site,
                    ]);
Activity icon

Replied to How Can Show Photo In Blade From Database

I'd recommend you not just saving the name of the file but the with the path -> $data[] = $imagePath; . '/' . $name so then in the blade you could do something like -

foreach(json_decode($product->images) as $image)
	{{ public_path($image) }}
endforeach

Also, it is not recommended to save the files in your public dir but in storage and then symlink it.

Activity icon

Replied to Validate Count Max Value With Text Include Break Line (new Line)

That, Or create a custom rule - https://laravel.com/docs/7.x/validation#custom-validation-rules Before executing the max logic just sanitise your input with removing the new lines and empty spaces, but handling that on the front end seems to be more accurate solution.

Jun
14
3 months ago
Activity icon

Replied to Where The Images Uploaded In Tinymce Are Stored? And In What Format It Is Stored?

Looks like tinymce expects images_upload_url in its init specifying what the upload url would be. Create a route for it in your backend for storing the image. https://www.tiny.cloud/docs/configure/file-image-upload/

Also look at https://www.tiny.cloud/docs-4x/general-configuration-guide/upload-images/

"Local images can be uploaded to TinyMCE through the use of the new editor.uploadImages() function. This functionality is handled asynchronously, meaning that it is possible for users to save their content before all images have completed uploading. If this occurs, no server path to the remote image is available, and the images are saved as Base 64.

It is recommended that the editor.uploadImages() function be executed before submitting the editor contents to the server, to avoid saving content as Base 64."

Jun
05
3 months ago
Activity icon

Replied to Reduce The Number Of Database Round Trips

Then I'd suggest rethinking the approach you are taking. You could chunk out all the inserts/updates and make queued jobs that will be taken in the background.

Activity icon

Replied to When Trying To Create A Item In Foreach The Item Is Not Being Created

At that point you are already in a loop so if dd($group) never gets hit then $course = ... never returns a proper result... That can be only an assumption at this point, as it feels too conditional to get to that code. If you are confident that conditions and how you get the Models are correct then try for creating the group another approach ->

$group = Group::create([
  'name' => ...,
  'user_id' => auth()->user()->id,
  ...
]);

Also, have you tried what I proposed at first $class = Classroom::where('name', $course->classroom)->first()->id;

Activity icon

Replied to Best Method To Create One-to-one Anonymous Chat?

Isn't that as simple as creating a chat system but hiding the names at the end... Just quickly seen that one https://pusher.com/tutorials/anonymous-chat-app-laravel and seems like a good approach and hives some ideas.

Activity icon

Replied to Using The Default RegisterController To Register From API

I use this approach https://laracasts.com/series/whats-new-in-laravel-7/episodes/6 and it works really well. Surely you can 'steal' some ideas from there. I see no reason for reinventing the wheel, Laravel ships with pretty awesome authentication package!