Popular Post


How to get filename from path in PHP?

Sometimes, we may require to get only filename or image name from full path or url in your PHP project or any framwwork project at that time you can get file name using php pre-define function basename. If you ever use this function then you can see as bellow example how it's works. I have one image url like, i want to just get image name then you can get image name like this way : <strong>Example:</strong> <pre class="prettyprint lang-php"> basename("http://itsolutionstuff.com/upload/Laravel-5-Mailgun.png"); </pre>

By Hardik Savani | June 30, 2016 | | 463 Viewer | Category : PHP
READ MORE

Laravel 5 - "syntax error or access violation 1055 in group by" Solved

Yesterday i was working on my Laravel 5.4 application and when i use group by statement in query builder I found error like as bellow: <br/> <strong> SQLSTATE[42000]: Syntax error or access violation: 1055 'admin.products.name' isn't in GROUP BY (SQL: select `products`.*, SUM(products_stock.stock) from `products` inner join `products_stock` on `products_stock`.`product_id` = `products`.`id` group by `products`.`id`) </strong> I was thinking what will be error and why it comes. i thought maybe it comes from mysql. i just add following query using laravel builder as like bellow: <strong>Laravel.....

By Hardik Savani | February 15, 2017 | | 458 Viewer | Category : Laravel
READ MORE

How to check file is exists or not in PHP?

If you need to check file is exixt or not on folder. Normally we require to check image is exist or not, video is exists or not etc. In this example i use file_exists() for determine file is available or not in given path. So if you also need check then follow bellow example: <strong>Example:</strong> <pre class="prettyprint lang-php"> if(file_exists('./upload/flower.jpg')){ print_r('Image is exist.'); }else{ print_r('Image is not exist.'); } </pre>

By Hardik Savani | April 26, 2016 | | 455 Viewer | Category : PHP
READ MORE

How to git ignore file permissions changes for commit?

When i was working on my PHP Laravel project and i clone project from git repository. I just composer install and then change storage folder permission. then i just run bellow command: <pre> git status </pre> I found list files of storage folder even i didn't changes on that file. I was thinking why there are several files on git status. But i understand this is because of permissions. I search google and other, at last i found bellow command that way we can ignore or remove or undo file permissions changes from git status. So, you can run bellow command in your repo. <pre class="prettyprint .....

By Hardik Savani | September 1, 2016 | | 455 Viewer | Category : Git
READ MORE

How to get keys name from array using array helper in PHP Laravel ?

Few days ago, I was working on my new Laravel 5.4 application and i require to get keys name from my array. i was thing how we can get it and laravel provide us for to do it. Finally i found array helper function in Laravel docs. There are several array helper function available for array. I found array_keys() helper for getting keys name from our array. array_keys() will return array of keys. It could be easy to work with keys name in array. So in this example i want to share with you small example using array_keys() helper. I created one route "myarraykeys" with my $myArray variable, and .....

By Hardik Savani | February 18, 2017 | | 449 Viewer | Category : PHP Laravel
READ MORE

How to enable rewrite mode for apache in ubuntu?

Whenever you need to rewrite index.php file from url you can find solution here. you can easily enable rewrite mode using bellow terminal command. when i create one virtualhost for my laravel application and open in browser and open my created virtual url. but when i click on login i found following error : <pre> URL not found.... </pre> But when i try add index.php like this way then it works: <pre> http://test.hd/index.php/login </pre> You can remove index.php from url so run following command: <pre class="prettyprint lang-php"> sudo a2enmod rewrite sudo service apache2 restart </pre> Now .....

By Hardik Savani | April 8, 2016 | | 442 Viewer | Category : Ubuntu Apache
READ MORE

How to create virtual host in ubuntu apache?

we always like to create virtual host and run our project that way we can debug properly and run as like our website. But if you are working on ubuntu then we have always follow several step to create virtual host and that very long process. So, i found one package that provide virtualhost command that way we can create new virtual host and also delete virtual host command. so just follow bellow step: <strong class="step">Create virtualhost command</strong> <pre> $ cd /usr/local/bin $ wget -O virtualhost https://raw.githubusercontent.com/RoverWire/virtualhost/master/virtualhost.sh $ chmod +x.....

By Hardik Savani | June 14, 2016 | | 439 Viewer | Category : Installation Ubuntu
READ MORE

How to add git add remote origin on bitbucket repository ?

when i was working on my laravel project with my friend. both are working on same project, when i changed on many files, he don't know and he changed name of repository on bitbucket and i couldn't push any thing, i told him. He know how can we resolve this issue so i remove my old remote and added new remote url on my existing repository. Finally, i solved my issue, if you also fetch issue like i had then you can just follow bellow command and solve. <strong>Terminal Command</strong> <pre class="prettyprint lang-php"> git remote -v git remote remove origin git remote add origin Bitbucket_Rep.....

By Hardik Savani | July 12, 2016 | | 438 Viewer | Category : Laravel
READ MORE

JQuery - how to get attribute value example

If you are new and you want to get attribute value then you can get easily. sometime maybe we also need to get custom attribute value, i mean data attribute value. In following example i give you three way to get custom attribute value in jquery. <strong class="example">Example:</strong> <pre class="prettyprint lang-html"> <html lang="en"> <head> <title>Get Custom Attribute Value</title> <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> </head> <body> <a href="example.com" data-id="1" myname="hd">Ex.....

By Hardik Savani | April 14, 2016 | | 437 Viewer | Category : Javascript jQuery
READ MORE

How to check word exist in string or not in PHP?

I want to share this posts because when i was working in my laravel application i need to find word from string, I mean check string contains word or not but i try to do, at last i found two way we can check easily. First one using preg_match and other one strpos() of php predefine. if you have question how to php regular expression match word then you can do this way: <strong>Example 1:</strong> <pre class="prettyprint lang-php"> $str = "Hi, I am from itsolutionstuff.com"; if (strpos($str, "from") !== false) { print_r("Yes, exists"); } </pre> <strong>Example 2:</strong> <pre class="prett.....

By Hardik Savani | May 3, 2016 | | 436 Viewer | Category : PHP
READ MORE


    How to send mail using zoho smtp server in PHP Laravel?

    How to send mail using zoho smtp server in PHP Laravel?

    Open Post

    How to integrate google map using gmaps.js in php example?

    How to integrate google map using gmaps.js in php example?

    Open Post

    Laravel 5 dynamic autocomplete search using select2 JS Ajax - Part 2

    Laravel 5 dynamic autocomplete search using select2 JS Ajax - Part 2

    Open Post

    Select box with search option example in Jquery using Chosen Plugin

    Select box with search option example in Jquery using Chosen Plugin

    Open Post

    Laravel 5 Redirect to URL using redirect() helper

    Laravel 5 Redirect to URL using redirect() helper

    Open Post

    How to use groupby having with DB::raw in Laravel Query Builder?

    How to use groupby having with DB::raw in Laravel Query Builder?

    Open Post