mindz

Experience

5,530

4 Best Reply Awards

  • Member Since 8 Months Ago
  • 32 Lessons Completed
  • 0 Favorites

13th September, 2017

mindz left a reply on Swift_TransportException With Mailtrap • 1 week ago

What smtp you using?

mindz left a reply on Store Date From Datepicker Into Db • 1 week ago

Dont know what plugin you use but there is a possibility to customize format

var date = $('#datepicker').datepicker({ dateFormat: 'dd-mm-yy' }).val();

mindz left a reply on Pass A Variable Into A Data Array To Send Email • 1 week ago

@almost_pitt

$posts = Post::all()->get(); // get() can be used on Builder object

either use

$posts = Post::all(); //returns collection

or

$posts = Post::get(); //returns collections

mindz left a reply on How To Show Old Value In Edit Blade. • 1 week ago

After submit? Or Before? Or you not submitting at all? Can't see any textfield ( i assumed you ment textfield not textfiled) in not formatted text you provided

mindz left a reply on Swift_TransportException With Mailtrap • 1 week ago

What OS you're using? You are aware you should have smpt server set up? Have you got it?

mindz left a reply on How To Show Old Value In Edit Blade. • 1 week ago

You have to write again what you want to acomplish. What is Old Value Old Value of what?

mindz left a reply on Swift_TransportException With Mailtrap • 1 week ago

provide mail.php config file from config/mail.php

mindz left a reply on When Posting Article, User_id Is 0. • 1 week ago

At first sight and obviously in my opinion you not providing user_id when you call

Article::create($request->all());

Of course my conclusion is false if you pass hidden field named user_id in your form but that is not standard approach.

You can do this in some ways.

First and simplest

 Article::create(array_merge($request->all(),['user_id'=>Auth::user()->id]));

Second

$article = Article::create($request->all());
$article->user()->associate(Auth::user())

Third via Observer

<?php

namespace App\Observers;

use App\User;

class ArticleObserver
{

    public function created(Article $article) //or saved
    {
        $article->user()->associate(Auth::user());
    }


}

mindz left a reply on Swift_TransportException With Mailtrap • 1 week ago

And you are sure that all config strings in .env are correct and not cached??

mindz left a reply on Swift_TransportException With Mailtrap • 1 week ago

Maybe you have issue with internet connection when not on vpn?

mindz left a reply on How To Show Old Value In Edit Blade. • 1 week ago

<input type="text" value="{{old('fieldName')}}" name="fieldName" />

mindz left a reply on Pusher Auth_key Error. • 1 week ago

@skoobi

I think you pass double encapsulated configs togetConfig function

In config/pusher.php you have main key in main keyed element.

So maybe instead of passing array of elements you passing array with array ?

I am no specialist of pusher but maybe this is the case.

mindz left a reply on Store Date From Datepicker Into Db • 1 week ago

@Cosmin89

$formatOfDateYouWany = Carbon::parse($request->get('datepicker')->eq(Carbon::today()))->format('yy-mm-dd')

12th September, 2017

mindz left a reply on Mail Queue - How To Handle Stacking Multiple Notifications / Messages Into 1 Email. • 1 week ago

I think i understand what You want to achieve. Therefore I would work it out in different way.

I would persist those emails data to storage with date field shouldBeSendAt . If user sends another message in application you update this storage row where email = email you want. You update field shouldBeSendAt = now()->addMinutes(3). Then you create a command executed every 1-3 minutes that check if there is anything with shouldBeSendAt in past. If there is it sending it.

With queue that you wanted to use there is a problem regarding fact that queue uses its own driver. It is definitley more complex to do it your way. In some ways impossile.

mindz left a reply on Store Date From Datepicker Into Db • 1 week ago

You must be more precise

If you want to check if datepickers date is current (i assume today)

Carbon::parse($request->get('datepicker')->eq(Carbon::today()))

mindz left a reply on Generate Dummy Data With Faker While Still Maintaining Consistent Data And Relationships • 1 week ago

If that would be the case. I would do it like that.

If you said that organization is related to purchase

$factory->define(App\Assessment::class, function (Faker $faker) {

$organizationByRandom = Organization::all()->random(); //or whatever
$relatedPurchase = organizationByRandom->purchase;

    return [
        'name' => $faker->name(),
        'email' => $faker->email(),
        'organization_id' => organizationByRandom->id
        'purchase_id' => $relatedPurchase->id
    ];
});

But remember that random is ineffective if you want to create milions of fake records. Better use randomElement on organizations ids array (pluck method)

17th June, 2017

mindz left a reply on Get Model Structure As Json • 3 months ago

Data structure is not keept in model. You have to phisically connect to database to retrive attribtutes.

In my opinion good aproach is to use some House class property (maybe) fillable or one created by yourself depending on your needs and some getter. Pack it in nice trait and use as you like.

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.