Category: Coding and Logic

  • Recommended way to access session in Laravel Views

    I noticed Session::get(‘error’) in a Laravel view file. Using classes directly in the view is not a good practice. So, I asked Lary to confirm. Q: Is accessing sessions in Laravel views with Session::get(‘error’) good or is there any better way? Lary: In Laravel, accessing the session in views using Session::get(‘error’) is a valid approach. However, Laravel provides…

  • Bad programming due to lack of basic knowledge

    Even though I have 15 years of experience as a full-stack developer, I make mistakes. Sometimes, silly mistakes. I am good at solving problems and providing solutions to complex business requirements. But I don’t know everything, even some basic things. Recently, my client asked me to add a feature to attach a file to the…

  • When comparing two arrays (in PHP), what is the difference between == and === ?

    Wish happy independence day to all Indians. I have not posted anything since a long time. I thought to break the silence with this small post. I was appearing for a skill test in Advanced PHP. I scored 82% (though I was expecting to get 90%), but I am upset as the percentile is just…

  • Importing MySQL Database in Mac Terminal

    Few days back I have posted “How to Dump MySQL Database to a file on Windows”. Exporting large database in phpMyAdmin is not much difficult (however the “command line” method is better), but importing large database in phpMyAdmin is a real headache. First you need to allow to upload a large file. For this you…

  • Dump MySQL Database to a file on Windows

    Most of the people out there are talking about dumping MySQL Database to a file on Linux servers. Many of you must be using MySQL on Windows, with WAMP. However, most of the PHP and MySQL powered websites and applications are hosted on a Linux server, most of the developers must be using WAMP on…