bashy

DevOps/Lead Developer at a UK Company

Hire Me

Experience

1,055,340

499 Best Reply Awards

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

25th May, 2017

bashy left a reply on Echo Adds "X-Socket-ID" To All AJAX Requests Which Breaks Other Cross-origin Requests • 17 hours ago

@mark.p.ramos What code exactly did you use for saving/restoring the contents or ajaxSettings?

24th May, 2017

bashy left a reply on Json Issue • 1 day ago

@ladhari Please format your code in a codeblock using 3 backticks ` at the start and end.

bashy left a reply on Force WWW Redirect With SSL Laravel • 1 day ago

@baqirfarooq It is. It's nginx based.

bashy left a reply on Order By Relationship Table • 1 day ago

Getting the first item from a relation is hard in Eloquent (from what I've experienced) because it doesn't know the columns before it's joined it.

You can get the latest issue of a magazine easily but that's only from a single collection item.

$magazine->issues()->latest('id')->take(1)->get();

first() may work instead of take but haven't tested.

bashy left a reply on Force WWW Redirect With SSL Laravel • 1 day ago

I always post this as a reply relating to redirecting www/non-www to HTTPS as it's always the same result

https://bashy.im/blog/nginx-redirect-to-https-with-without-www-subdomain

bashy left a reply on How To Secure API Endpoints For An App That Doesn't Have A Login? • 1 day ago

@gustav1105 Well, it does have the ability for you to use generated tokens without a user.

You can follow this to protect routes: https://laravel.com/docs/5.4/passport#protecting-routes

bashy left a reply on Can't Get Image From Storage... • 1 day ago

@Snapey Also the ownership of the symlink I think?

bashy left a reply on Wordpress With Laravel On Subfolder • 1 day ago

If you can't view root files and everything directs to public folder, sounds good to me. I don't know Apache well enough, only nginx.

23rd May, 2017

bashy left a reply on Can't Get Image From Storage... • 2 days ago

Do some tests with symlinks and also putting the files in actual folders in /public/

22nd May, 2017

bashy left a reply on How Does Laravel Map View Cache? • 3 days ago

You can check yourself in the framework code but here's what I see https://github.com/laravel/framework/blob/master/src/Illuminate/View/Compilers/Compiler.php#L51

bashy left a reply on No Such File Or Directory Error (Laravel/Homestead) • 3 days ago

Well you can show homestead.yaml so I can see how you'd mounted the paths but I doubt you've mounted it to /Users/.

bashy left a reply on How Does Laravel Map View Cache? • 3 days ago

Uses sha1() for the filenames. Maybe the path is used.

bashy left a reply on No Such File Or Directory Error (Laravel/Homestead) • 3 days ago

I see. Well looking into the Homestead issue then; why do you get /Users/Victor/Sites/ error when using Homestead? Sounds like it can't write locally, not on the VM.

bashy left a reply on Question About Props • 3 days ago

Something like this is probably best asked on the Vue forums or SO. Otherwise it sounds like you have a solution for now.

bashy left a reply on No Such File Or Directory Error (Laravel/Homestead) • 3 days ago

I know you probably don't want to hear "try another piece of software!" but this will really save you a lot of time; https://laravel.com/docs/5.4/valet

I can't tell what the problem you're facing is but let me know your thoughts on Valet. If not, I'll help with Homestead.

bashy left a reply on Open Route .show When Onchange A Dropdown • 3 days ago

Yeah, I've used it before which is why I knew what you were doing wrong :)

It's this part that gets the value from the selected option;

top.location.href = this.options[this.selectedIndex].value

bashy left a reply on Can't Get Image From Storage... • 3 days ago

Some LEMP/LAMP setups don't allow following symlinks. Check with your host that they follow them within the vhost.

bashy left a reply on Open Route .show When Onchange A Dropdown • 3 days ago

You want something like this within the onchange attribute.

<select id="apports" type="dropdown-toggle" class="form-control" name="apports" onchange="top.location.href = this.options[this.selectedIndex].value">
    <option value="choisir" selected disabled>Choisir</option>

    @foreach($tests as $test)
        <option class="apports" value="{{ route("tests.show", $test->id) }}">{{$test->apports}}</option>
    @endforeach
</select>

Just make the value attribute the route value and it will change page.

bashy left a reply on Downloading Laravel • 3 days ago

You can view the source here: https://github.com/laravel/laravel

Or download the files here: https://github.com/laravel/laravel/archive/master.zip

18th May, 2017

bashy left a reply on Error Uploading An Image With Vue Js • 1 week ago

What is the 500 error message? CSRF? Method not allowed?

bashy left a reply on Have Anyone Used Skype Api Ever? • 1 week ago

Never used.

17th May, 2017

bashy left a reply on Route Model Binding With 2 Models? • 1 week ago

@bunnypro Can do two unique validation rules on one field can't you? Should be easy enough to add a custom validator if not. :)

16th May, 2017

bashy left a reply on Wordpress With Laravel On Subfolder • 1 week ago

@tarik That solves nothing in this case I'm afraid.

bashy left a reply on Route Model Binding With 2 Models? • 1 week ago

I think the only way is to have 1 route and 1 controller for both. You'll need to then query blogs first to check if it exists, then move on to articles if not. Can't really use Route Binding here.

bashy left a reply on Laravel 5, Custom Error Messages. • 1 week ago

@devEs This thread is 2 years old so things have changed. Open another post I think.

15th May, 2017

bashy left a reply on Installed Php 5.5 • 1 week ago

@firstpointdev Ah you're compiling from source. Just have a look around, php.ini will have extensions loads in case.

bashy left a reply on Wordpress With Laravel On Subfolder • 1 week ago

@Vitor It's always best not to expose the Laravel root files at all to the browser. If .htaccess stops working one day, your credentials are gone.

I would actually opt for an alias (symlink). This is much easier with nginx imho but I wouldn't be able to help much with Apache since the syntax makes me feel sick :)

bashy left a reply on Installed Php 5.5 • 1 week ago

@firstpointdev Have you installed the extension for the 5.5 version as well? Have you checked it's enabled in the mods-available/enabled folders?

bashy left a reply on Wordpress With Laravel On Subfolder • 1 week ago

@Vitor Assets still work and everything? Can't view .env or composer.json files?

bashy left a reply on Installed Php 5.5 • 1 week ago

You have sudo apt install php-mysql installed? Can you check php -i | grep "pdo_mysql" or something?

bashy left a reply on Laravel-ide-helper Does Not Work In Api.php But Works Fine In Web.php • 1 week ago

@ahmadbadpey I know why you would want it, I stated that the Laravel plugin won't allow that via additional packages?

bashy left a reply on Laravel Assets Not Loading - 404 • 1 week ago

@lifesound Sorry, was busy at the weekend so didn't see mention!

wishes there was an email for mentions

13th May, 2017

bashy left a reply on How To Stop Page From Turning Into Json From Response()->json($results); • 1 week ago

You can't submit a form and do AJAX as well. Make the submit button a type="button" and just listen on .click() instead. It won't reload the page.

bashy left a reply on Doubt On Logic Laravel 5.4 • 1 week ago

I see a question but can't understand which part you're having trouble with.

You "found a logic" but we need to know which part you worked out and which are you having trouble with.

11th May, 2017

bashy left a reply on Laravel Plain Text Instead Of Homepage • 2 weeks ago

Ok well after that, I have no additional things I can think of. Sorry.

bashy left a reply on Custom Error Messages Laravel Auth • 2 weeks ago

@renoirfaria Strange use case but as @stanb stated, custom validation rule is where to go.

bashy left a reply on Custom Error Messages Laravel Auth • 2 weeks ago

What have you added for "new lines of business"?

If someone tries to register with the same email, you already have this implemented by default.

'email' => 'required|email|max:255|unique:users',

This will return back to the register page with the error that matches "unique" array item.

bashy left a reply on Laravel Plain Text Instead Of Homepage • 2 weeks ago

@essteffan You shouldn't go off what is displayed on the page. I was asking for the live result of that page rendering. If it was in fact text/html, if would show as HTML, not text.

Lastly, I said see if you have a dd() (or something similar) somewhere in your code because the output could be that.

bashy left a reply on Remove Public/index.php From URL • 2 weeks ago

@Ac1988 And welcome to website exploit city.

bashy left a reply on Laravel Plain Text Instead Of Homepage • 2 weeks ago

@essteffan Do you know if the http status code is 200 or? Also the content-type may help.

You may have a dd() in some condition like if () { dd(); }.

bashy left a reply on Laravel Plain Text Instead Of Homepage • 2 weeks ago

Looks like something is dumping the header information or some plugin/extension is doing it. Never seen that myself.

The "0" in the top left is an indicator.

bashy left a reply on Virtual Box Is Not Functioning After I Upgraded To 2.1.0 • 2 weeks ago

@steeve That's what I like to hear! valet secure is great too for https.

Few pointers for others;

  • If you're doing an app/website with basic to semi-advanced software requirements, it's great. Any advanced software will (ideally) run on macOS with some
  • Using macOS as the base OS will mean that if you deploy to Linux and you missed a capitalised letter in an import or class name, you'll have errors with that. Linux is case-sensitive whereas macOS is not.

10th May, 2017

bashy left a reply on Component Import • 2 weeks ago

Try

components: {
    GISView
},

bashy left a reply on Laravel Can't Install, No Vendor File • 2 weeks ago

Run composer install within the root of the project.

9th May, 2017

bashy left a reply on How Add Generated Code Like YYMM0001 When Register At Laravel 5.4 • 2 weeks ago

Then use two columns and put them together with php using str_pad and date YY and MM format.

bashy left a reply on How Add Generated Code Like YYMM0001 When Register At Laravel 5.4 • 2 weeks ago

@FaiChan Is YYMM the year and month? Will you just want 0001-9999? You could str_pad an ID to get the number.

bashy left a reply on Inconsistently Slow Response Times - SQS, RDS, Elasticache • 2 weeks ago

@dtirer That's just because they have load balancing but yeah, maybe you won't be able to.

You may be able to try a cURL request manually on the server. That way you can see if it's timing out or just some other error.

bashy left a reply on How Add Generated Code Like YYMM0001 When Register At Laravel 5.4 • 2 weeks ago

In app/Http/Controllers/Auth/RegisterController.php?

You should generate that code within the create method since having it in the form will result in possible data manipulation by the user.

/**
     * Create a new user instance after a valid registration.
     *
     * @param  array  $data
     * @return User
     */
    protected function create(array $data)
    {
        return User::create([
            'name' => $data['name'],
            'email' => $data['email'],
            'password' => bcrypt($data['password']),
        ]);
    }
Edit Your Profile
Update

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