danielcoimbra

Experience

23,585

1 Best Reply Awards

  • Member Since 4 Years Ago
  • 490 Lessons Completed
  • 15 Favorites

11th August, 2018

danielcoimbra left a reply on Vue Powered Collapsable Sidebar Menu • 1 week ago

I made a side menu using Vue.js for a project some time ago. You can find the Vue Side Menu GitHub repository here. For reference, maybe it can help others trying to find similar examples in the future.

9th February, 2018

danielcoimbra left a reply on Homestead - Wrong Time • 6 months ago

Try these steps:

1 - vagrant ssh (into Homestead VM)

2 - sudo dpkg-reconfigure tzdata (and choose your region)

21st December, 2017

danielcoimbra left a reply on How Can I Get Domain Name Used To Visit An App? • 8 months ago

request()->getHost();

From Laravel Docs: "The Illuminate\Http\Request instance provides a variety of methods for examining the HTTP request for your application and extends the Symfony\Component\HttpFoundation\Request class."

The Symfony\Component\HttpFoundation\Request has a method getHost() as described here: http://api.symfony.com/3.0/Symfony/Component/HttpFoundation/Request.html#method_getHost

26th February, 2017

danielcoimbra left a reply on Is There A Way To Remove "Connected To Browser Sync" Notification From Laravel Mix Browsersync? • 1 year ago

The recommended way, is to disable notifications:

mix.browserSync({
    proxy: 'my-domain.dev',
    files: ['public/css/*.css', 'public/js/*.js'],
    notify: false
});

9th February, 2017

danielcoimbra left a reply on Resize An Image Before Upload To S3 • 1 year ago

My working code is:

$file = request()->file('my_input_file_name');

$imageName = $file->getClientOriginalName();

$img = Image::make($file);

$img->resize(null, 1000, function ($constraint) {
    $constraint->aspectRatio();
});

//detach method is the key! Hours to find it... :/
$resource = $img->stream()->detach();

$path = Storage::disk('s3')->put(
    'my-s3-folder/' . $imageName,
    $resource
);

danielcoimbra left a reply on Saving An Intervention Image Instance Into Amazon S3 • 1 year ago

My working code is:

$file = request()->file('my_input_file_name');

$imageName = $file->getClientOriginalName();

$img = Image::make($file);

$img->resize(null, 1000, function ($constraint) {
    $constraint->aspectRatio();
});

//detach method is the key! Hours to find it... :/
$resource = $img->stream()->detach();

$path = Storage::disk('s3')->put(
    'my-s3-folder/' . $imageName,
        $resource
);

21st September, 2016

danielcoimbra left a reply on Submit Serialized Form Data With Vue • 1 year ago

Here is the solution:

let myForm = document.getElementById('myForm');

var formData = new FormData(myForm);

//if necessary...
formData.append('foo', 'bar'); 

this.$http.post('/api', formData);

10th May, 2016

danielcoimbra left a reply on HasManyThrough With Only Two Models • 2 years ago

Hi! Look at belongsToMany relationship... It's what you are looking for. See: https://github.com/laravel/framework/issues/441#issuecomment-14213883

19th March, 2015

danielcoimbra left a reply on Using Laravel Auth For Multiple Tables • 3 years ago

As at the moment the package have not been ported to Laravel 5, I'm using Laravel 5 native auth to handle multiple tables...

It's not difficult, please check this Gist:

https://gist.github.com/danielcoimbra/64b779b4d9e522bc3373

Daniel

Edit Your Profile
Update

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