bestmomo

Experience

373,920

448 Best Reply Awards

  • Member Since 3 Years Ago
  • 19 Lessons Completed
  • 0 Favorites

18th January, 2018

bestmomo left a reply on Upgrade Laravel Version • 4 days ago

The best way for upgrades is to start with a fresh install and copy all custom files and partial codes. It's longer but so cleaner !

17th January, 2018

bestmomo left a reply on Repositories • 4 days ago

Looks weird, check the typo, sometimes there is a hidden stuff...

bestmomo left a reply on Repositories • 4 days ago

Try a composer dumpautoload

16th January, 2018

bestmomo left a reply on Laravel Localization For Long Strings • 5 days ago

Maybe this package can help : https://github.com/Waavi/translation

12th January, 2018

bestmomo left a reply on Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException No Message Error • 1 week ago

Hello,

Are you sure you use good verbs in your forms ?

11th January, 2018

bestmomo left a reply on Get All Artisan Commands • 1 week ago

Thanks,

I tried but it's a long Symfony trip...

bestmomo started a new conversation Get All Artisan Commands • 1 week ago

Hello,

To get all Artisan commands we can use the all inherited from symfony with Àrtisan::all()`. But with this method we dont get the custom packages commands.

Does someone knows a simple way to get them to avoid searching in symfony ? Thanks...

10th January, 2018

bestmomo left a reply on Force Https Laravel 5.5 • 1 week ago

Why not use htaccess ? Something like that :

   RewriteCond %{HTTPS} !=on

   RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

17th November, 2017

bestmomo left a reply on Laravel Remember Me Checkbox Not Working • 2 months ago

From documentation :

If you are using the built-in **LoginController** that is shipped with Laravel, the proper logic to "remember" users is already implemented by the traits used by the controller.

16th November, 2017

bestmomo left a reply on Best Way To Generate Page Titles? • 2 months ago

Another way I use to get some automatism :

I have a config for titles based on routes names :

<?php

return [

    'admin' => 'dashboard',
    'users' => [
        'index' => 'usersGestion',
        'edit' => 'userEdit',
    ],

   ...

And lang files for translations :

<?php

    'titles' => [
        'dashboard' => 'Dashboard',
        'usersGestion' => 'Users Gestion',
        'userEdit' => 'User Edition',
        'contactsGestion' => 'Contacts Gestion',

    ...

Then in a view composer :

$title = config('titles.' . Route::currentRouteName());
$title = __('admin.titles.' . $title);

$view->with(compact('title', '...));

So in layout just set :

{{ $title }}

And it works :)

8th September, 2017

bestmomo left a reply on How Create Nested Relationship Over Three Models • 4 months ago

In your controller something like that :

$treatment = Treatment::with('products')->find($treatment_id)

bestmomo left a reply on How Create Nested Relationship Over Three Models • 4 months ago

So when you edit a treatment you must eager load all the products and you can access the pivot...

bestmomo left a reply on How Create Nested Relationship Over Three Models • 4 months ago

But you edit a treatment that can have many products ?

bestmomo left a reply on [L 5.3] Api Route 405 Method Not Allowed • 4 months ago

Are you sure POST is a correct verb for an API ?

bestmomo left a reply on How Create Nested Relationship Over Three Models • 4 months ago

Sounds weird, as you need same informations for show and edit.

bestmomo left a reply on Adding/Removing Database Columns • 4 months ago

Hi,

Why not simply call the Artisan commande ?

bestmomo left a reply on How Create Nested Relationship Over Three Models • 4 months ago

Not sure of your queries, but looks like in this case it's rather :

$treatment->pivot->units_per_interval

bestmomo left a reply on How Create Nested Relationship Over Three Models • 4 months ago

I dont see the diffrence between show and edit about this attribute.

7th September, 2017

bestmomo left a reply on How Create Nested Relationship Over Three Models • 4 months ago

Why not simply add a column amount in product_preatment pivot (withPivot) ?

bestmomo left a reply on How Create Nested Relationship Over Three Models • 4 months ago

Hi,

I dont understand the difference between Treatments and Prescriptions.

bestmomo left a reply on I Am Unable To Use PHP Math Class In A Laravel Controller • 4 months ago

Just use log10(val).

6th September, 2017

bestmomo left a reply on Localization Set A Locale • 4 months ago

The locale setted with setLocale is only for the current request as any config parameter.

3rd September, 2017

bestmomo left a reply on Eloquent Relation Scopes? • 4 months ago

Hi,

Why not a method in Product model ?

public function firstPhoto()
{
    return $this->belongsToMany('App\Photo')->first();
}

bestmomo left a reply on Posting Without Clicking The Captcha Loses Old Data • 4 months ago

It's a good way to move your memory forward ;)

bestmomo started a new conversation Laravel 5.5 Example • 4 months ago

For information I've posted a new repository with a simple Laravel 5.5 blog example for tutorial with authentication (with email confirmation), roles, articles, tags, search, nested comments, messages, simple localization, administration, medias, multi users files management, application tests...

Hope it may help...

26th May, 2017

bestmomo left a reply on Use And Namespace • 7 months ago

Hello,

Composer generate an array in vendor/composer/autoload_classmap.php. So PHP can find the classes with a use.

15th May, 2017

bestmomo left a reply on [Package] Artisan Commands For Language Strings • 8 months ago

Sorry, I forgot to put the link.

bestmomo started a new conversation [Package] Artisan Commands For Language Strings • 8 months ago

Hello,

When you have all your base strings in your project you have no way to easily get them to create a JSON file for a locale. You have to check all files...

So, as i didn't find a package to help me, I made some artisan commands to automatise that. And now I share them in a package.

Hope it'll be helpfull.

4th May, 2017

bestmomo left a reply on Route Error • 8 months ago

Hello,

Which PHP version do you use ?

bestmomo left a reply on Dusk : Interact With CKEditor • 8 months ago

@dnlcorrea

Nice, it works ;)

bestmomo left a reply on Dusk : Interact With CKEditor • 8 months ago

Thanks I'm going to try your code ;)

19th April, 2017

bestmomo started a new conversation Dusk : Interact With CKEditor • 9 months ago

Hello,

All in title, I cant interact with CKEditor body read or write.

Is someone knows how to do that...

20th March, 2017

bestmomo left a reply on Dusk : Click A Font Awesome Icon • 10 months ago

@alenabdula

Thanks for answer but I tried it and error is :

Facebook\WebDriver\Exception\UnknownServerException: unknown error: Element is not clickable at point (184, 927)

This error is commented there. So I must get a descendant element.

bestmomo started a new conversation Dusk : Click A Font Awesome Icon • 10 months ago

Hi,

I'm struggling with Dusk. I try to $browser->click(...) on a font awesome icon but I cant find a good selector to get it.

My code is classic :

<a id="comment-edit13" href="#" class="editcomment">
    <span class="fa fa-fw fa-pencil fa-lg pull-right" title="Edit comment">
    </span>
</a>

There is creation of a before pseudo-element in span for the icon, so looks like selector must be something like #comment-edit13 span::beforebut I get :

Facebook\WebDriver\Exception\NoSuchElementException: no such element: Unable to locate element: {"method":"css selector","selector":"body #comment-edit13 span::before"}

Maybe I miss something...

11th March, 2017

bestmomo left a reply on Installing Laravel • 10 months ago

Hello,

On Windows try Laragon, it's not a virtual machine but it's perfect for Laravel.

27th February, 2017

bestmomo left a reply on Adding A Condition To Authentication - 5.3 • 10 months ago

@iHmD

I think it is implied but you're right ;)

bestmomo left a reply on Creating REST API With More Actions Other Than Usual CRUD. • 10 months ago

@ka.hazem

You just get parameters in your controller :

public function show($frequency, $lead) {
    ...

5th February, 2017

bestmomo left a reply on Laravel Email Authentication Package • 11 months ago

You should have done it a little earlier because I also did one. You have another approach for fresh project. I like it.

bestmomo left a reply on Package For Email Confirmation • 11 months ago

Thanks

bestmomo started a new conversation Package For Email Confirmation • 11 months ago

As I didn't find a good package for email confirmation I made my own, hope it may help other people.

5th January, 2017

bestmomo left a reply on Laravel 5.3 Example • 1 year ago

Not big changes in controllers, just send back a JSON response.

21st December, 2016

bestmomo left a reply on How Do I Create A Custom 404 / Error Page? • 1 year ago

@altafneva

Looks like a server requirements issue. Check this list.

30th November, 2016

bestmomo left a reply on Laravel 5.3 Example • 1 year ago

Thanks, but not sure to understand your question.

25th November, 2016

bestmomo left a reply on Does `get(1)` Do The Same As `first()` Or `take(1)` ? • 1 year ago

What is the error ? With first and take(1) you get a model and with get() you get a collection.

23rd November, 2016

11th November, 2016

bestmomo left a reply on When To Use Colon (:) When Passing Data To Props • 1 year ago

What is surprising is if it works with sub-id...

bestmomo left a reply on How To Translate PasswordResetEmail? • 1 year ago

May be a working example may help.

bestmomo left a reply on Blade, Variable In Trans() URL? • 1 year ago

Hi,

What do you get with this code ?

bestmomo left a reply on Laravel Web Installer • 1 year ago

You also can try this one.

10th November, 2016

bestmomo left a reply on Laravel • 1 year ago

@bobbybouwmann I could but I dont speak bot !

Edit Your Profile
Update

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