bashy

DevOps/Lead Developer at a UK Company

Hire Me

Experience

1,067,980

513 Best Reply Awards

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

27th July, 2017

bashy left a reply on Laravel 5.5 - LTS Release • 11 hours ago

@pavj888 There's quite a lot of changes but it'll mostly just depend on the app you're converting. If it has a lot of manual emailing, be prepared to convert those to either Notifications or Mailables.

bashy left a reply on Structure Question • 11 hours ago

Can see better now.

From what I just checked (few minutes), it looks fine. Remember, you can always tweak when developing it if you find something can be done better.

bashy left a reply on Structure Question • 20 hours ago

You should probably highlight a few table columns with backticks so we can scan over them and think about it properly. Right now it just looks like a wall of text.

Like so: teacher_id

26th July, 2017

bashy left a reply on [NEED HELP] Subdomain • 1 day ago

@syahmiibrahim Depends what you need it for. If you just want it for aesthetics, you can just add a middleware to check the subdomain exists etc.

25th July, 2017

bashy left a reply on How Can We Parse Repeated URL Params In Laravel? • 2 days ago

@lostdreamer_nl And a HTML form (browser) only sends the last one as well (unless an array).

24th July, 2017

bashy left a reply on Get User In Middleware • 3 days ago

@mertizci This is an old thread but the web middleware should be there by default (Laravel 5.4 install) on all web.php routes. Make sure you're not adding it twice by checking the route:list!

21st July, 2017

bashy left a reply on Command - Best Option For Reminder Emails 2 Weeks Before Due Date Column • 6 days ago

@Ricardo Yeah makes sense and what I thought. Thank you!

bashy left a reply on Command - Best Option For Reminder Emails 2 Weeks Before Due Date Column • 6 days ago

@Ricardo What time would you run it daily? If I run it just after midnight, it won't then catch any entries added that day that have a 2 week timeframe? Or am I thinking about it too much...

20th July, 2017

bashy left a reply on Command - Best Option For Reminder Emails 2 Weeks Before Due Date Column • 1 week ago

@jlrdw Good to see you about still! Enjoyed learning and giving advice :) Thanks for the feedback on that.

@Ricardo Yeah I guess it would be daily and you wouldn't get duplicates! Totally didn't think about that. Thanks!

bashy left a reply on Help, Can't Install Laravel Mix In Laravel Homestead. • 1 week ago

I have no clue what that response is. Did you add the new path to your $PATH on the Homestead machine?

bashy left a reply on Guzzle Http Post Request Not Working. • 1 week ago

Why do you need to make a POST request via Guzzle on the same app?

Can't you just do something like this?

// /routes/web.php
Route::get('testing', [email protected]'); // string 'success'
Route::post('testing_post', [email protected]_post'); // string 'success'


// app/Http/Controllers/SomeController.php
public function test()
{
    return $this->test_post(); // string 'success'
}

public function test_post()
{
    return 'success';
}

bashy left a reply on Guzzle Http Post Request Not Working. • 1 week ago

If you want to ignore the exception and see the body of the response, you can pass 'exceptions' => false, to Guzzle options.

bashy started a new conversation Command - Best Option For Reminder Emails 2 Weeks Before Due Date Column • 1 week ago

Hi all,

I have a command that pulls out entries from the DB that will have a due date that's 2 weeks from current date. I'm able to send the reminder email etc but what I need some opinions on is the following;

Since the reminder emails are being sent 2 weeks before the due date, I need some way of not sending duplicate notifications. Is it a good idea to put another column to update after sending the reminder? Maybe reminder_sent boolean or reminder_at date?

bashy left a reply on Help, Can't Install Laravel Mix In Laravel Homestead. • 1 week ago

Yeah that is not really the error. It's just saying what commands you used.

On Homestead you can just do npm install. If it says you don't have permission, you can do this to;

npm config set prefix ~/.npm

Then add $HOME/npm/bin to $PATH (append to .bashrc, .zshrc or similar) like below

export PATH="$PATH:$HOME/.npm/bin"

bashy left a reply on Help, Can't Install Laravel Mix In Laravel Homestead. • 1 week ago

That's no real error tbh :)

14th July, 2017

bashy left a reply on Notifications Help • 1 week ago

Writing a schedule to to pull out the items that need to be sent for a given time would be the best (imho).

bashy left a reply on Notifications Help • 1 week ago

Why are you wanting to delay the notification instead of sending the notifications on a cronjob?

That way you can query and send them based on the remind_on field?

bashy left a reply on Seeing 404 Exept Home Page • 1 week ago

Your web server isn't passing the rewrite to index.php then.

Apache? What does your vhost look like?

bashy left a reply on How Can I Add An IP Range To Access MYSQL Port 3306? • 1 week ago

If you want to get a large block like that, you should probably use x.x.x.x/16 etc.

Have a look at UFW as thats on Ubuntu by default (unless you're using a different OS than standard Forge.

bashy left a reply on PHPstorm Not VueJS Friendly? • 1 week ago

Actually, at work it seems fine. Maybe it's something else on my laptop that's causing it (or an update).

@Rainieren Use markdown so ![this is alt text](direct image url here)

13th July, 2017

bashy left a reply on PHPstorm Not VueJS Friendly? • 2 weeks ago

Methods and stuff work fine for me but HTML attributes don't. v-else and v-for etc all say "Attribute v-for is not allowed here". I don't think that's the plugin's purpose though.

Have you changed your JavaScript to ES6 to see if that helps?

bashy left a reply on Bug With Edit Profile • 2 weeks ago

Same.

bashy left a reply on Digital Ocean Not Executing Uploaded Files Correctly • 2 weeks ago

Strange then!

12th July, 2017

bashy left a reply on Digital Ocean Not Executing Uploaded Files Correctly • 2 weeks ago

Did you enable PHP OPcache by any chance?

bashy left a reply on Test • 2 weeks ago

@jamesjames Can't yourself but you could ask Jeffrey.

6th July, 2017

bashy left a reply on "/" In Hash Interfering With Route • 3 weeks ago

Then don't use a hash in the URI. Change it to be something else or you could bodge it (with some work on the example I'm giving below obviously.

Route::get('loc/conf/{confBatch}/{confBatch2?}', 'loc\[email protected]');

// controller
public function Conf($confBatch, $confBatch2) {
    $hash = $confBatch.$confBatch2;
}

bashy left a reply on Order By Field • 3 weeks ago

@Robstar Think that was for mikevrind

5th July, 2017

bashy left a reply on Order By Field • 3 weeks ago

I had one look at the above code and lost interest :(

4th July, 2017

bashy left a reply on How To Download File From Your System • 3 weeks ago

@jha That's fine for public facing files. I assumed it's being stored in storage folder.

bashy left a reply on Order By Field • 3 weeks ago

Yeah but what does getProducts do? Just need to know how to tell you to format your conditional order by.

bashy left a reply on Order By Field • 3 weeks ago

Huh?

public function products($category_url)
{
    Product::getProducts($category_url, self:: $data);

    return view ('content.products', self::$data);
}

bashy left a reply on How To Download File From Your System • 3 weeks ago

Well, if you're using PHP to serve the file, you can find the path and do this;

return response()->download($full->getPath(), 'custom-file-name.pdf', [
    'Content-Type' => $file->mime_type,
    'Content-Length' => $file->Size,
]);

I use this to manage my uploads and serve the files easier: https://github.com/spatie/laravel-medialibrary

bashy left a reply on Using Imgur API For User Profile Picture In App • 3 weeks ago

Have you read the API docs? https://apidocs.imgur.com/#4b8da0b3-3e73-13f0-d60b-2ff715e8394f

Just send a POST request with the data and receive the URL to add into the DB or w/e you're using.

bashy left a reply on Order By Field • 3 weeks ago

@R0.IT What's your getProducts() method?

@mikevrind Not sure where or if it is but I use it all the time for conditional queries :)

bashy left a reply on Echo + Pusher: Listen To Member_added & Member_removed On Server • 3 weeks ago

Cool, webhooks are way better :)

bashy left a reply on Order By Field • 3 weeks ago

@bastman69 Note that that collections link is for collections. Also, they wanted to know more how to display it than how to sort the data.

3rd July, 2017

bashy left a reply on How To Use Git To Edit The Env File Before Push It To Server? • 3 weeks ago

Do you at some point run php artisan config:cache? Editing .env after that won't have an affect since the data in the config files are cached.

Need to know a bit more about your setup to help you really. I don't commit .env files and I set mine up with my deployment service so it's all synced.

bashy left a reply on Order By Field • 3 weeks ago

I work with CRMs and data systems a lot and the following is something that I do to solve this.

Instead of having a separate method, just use the index one (where you list the data) and pass query strings to it.

public function index(Request $request)
{
    $sort = $request->get('sort', null);

    $products = Product::when($sort, function ($query) use ($sort) {
        // can use the $sort var here if you wish to pass the column or asc/desc
        $query->orderBy('price', 'desc');
    })->get();
}

Then you can just sort it with a link or form depending on what your front-end is like.

<a href="{{ route('products.index', ['sort' => 'price']) }}">Sort by Price</a>

bashy left a reply on Echo + Pusher: Listen To Member_added & Member_removed On Server • 3 weeks ago

You can't really total up the time spent online through JS easily but you could do a join/leave time then add those as rows in a table to calculate the difference?

.joining((user) => {
    // request to save user + timestamp
})
.leaving((user) => {
    // request to save user + timestamp
})
                        

bashy left a reply on Trailing Slash • 3 weeks ago

This is all based on how your web server is setup.

Laravel won't care about if there's a trailing slash or not. All it will do is escape each and every one of them and use the segments to route URLs.

bashy left a reply on Can't Get Getenv('key'); • 3 weeks ago

@mushood Yeah shouldn't have to run config:cache on local. I'm sure there's somewhere where env() doesn't work as well... constructors?

bashy left a reply on Can't Get Getenv('key'); • 3 weeks ago

@lara123 I'm not sure getenv() will be able to read the Laravel set environment keys as it uses DotEnv package: https://laravel.com/docs/5.4/configuration#environment-configuration

The method I stated is written here: https://laravel.com/docs/5.4/configuration#accessing-configuration-values

bashy left a reply on Can't Get Getenv('key'); • 3 weeks ago

Use config() instead like so;

config('broadcast.connections.pusher.key');

27th June, 2017

bashy left a reply on Forge With Amazon Lightsail • 1 month ago

@njames007 Yeah that's not really possible since it needs a certain setup to automate the stuff it does. I've not used it but it will basically set them up the same as using the services (DO, Linode, AWS).

26th June, 2017

bashy left a reply on GoDaddy And Laravel • 1 month ago

@jlrdw If they don't, moan to them for not supporting an active PHP version :)

bashy left a reply on GoDaddy And Laravel • 1 month ago

@jlrdw Just stay on 5.1 then? Most code bases work fine on PHP7 anyway.

25th June, 2017

bashy left a reply on Restricting 2FA Only For Users On Paid Plans • 1 month ago

In my eyes, anyone enabling 2FA has a auth app.

23rd June, 2017

bashy left a reply on Restricting 2FA Only For Users On Paid Plans • 1 month ago

Authy only sends SMSs if you set it up to do so. There's two sides. OTP (One-time password) is 2FA but token based.

A lot of sites use token based 2FA.

I wouldn't pay to get 2FA support

bashy left a reply on Restricting 2FA Only For Users On Paid Plans • 1 month ago

I was thinking more https://authy.com type with authenticator app?

bashy left a reply on Restricting 2FA Only For Users On Paid Plans • 1 month ago

Cost?

Edit Your Profile
Update

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