Laravel 5 Failed opening required bootstrap/../vendor/autoload.php

Published on

bootstrap/../vendor/autoload.php. Failed to open stream: No such file or directory. The “vendor” folder does not exist. Which OS you are using ? For Windows : Go to Command Prompt set path to www/{ur project} For me : www/laravel5 Then type this command : composer install It will automatically install all dependency in vendor/ ————————/OR/—————————- Run … Continue reading Laravel 5 Failed opening required bootstrap/../vendor/autoload.php

FatalErrorException in TaskQueue.php line 13 in Laravel 5

Published on

FatalErrorException in TaskQueue.php line 13 in Laravel 5. The class “TaskQueueInterface” had not be found. The following is my solution: open the folder: /vendor/guzzlehttp/promises/src edit TaskQueue.php modify “class TaskQueue implements TaskQueueInterface” to “class TaskQueue” After doing the above, stay tuned for the official release.

how to include or use phpcrawl to the project

Published on

PHPCrawl is a framework for crawling/spidering websites written in the programming language PHP, so just call it a webcrawler-library or crawler-engine for PHP PHPCrawl “spiders” websites and passes information about all found documents (pages, links, files ans so on) for futher processing to users of the library. It is high configurable and provides several options … Continue reading how to include or use phpcrawl to the project

How can I integrate the new Google Cloud Messaging in a PHP?

Published on

GCM with PHP (Google Cloud Messaging) The cURL code that’s on the page that Elad Nava has put here works. Elad has commented about the error he’s receiving. String describing an error that occurred while processing the message for that recipient. The possible values are the same as documented in the above table, plus “Unavailable” … Continue reading How can I integrate the new Google Cloud Messaging in a PHP?

How to Split a string every time it reaches 4 digits using regular expressions in php

Published on

Split a string every time it reaches 4 digits using regular expressions in php. Want to use preg_match_all: $str = ‘ABCDE1234ABCD1234ABCDEF1234’; preg_match_all(‘/[a-z]+[0-9]{4}/i’, $str, $matches); var_dump($matches); Output: array(1) { [0]=> array(3) { [0]=> string(9) “ABCDE1234” [1]=> string(8) “ABCD1234” [2]=> string(10) “ABCDEF1234”}} —————————————————/OR/————————————————- Use the principle of contrast: \D+\d{4} # requires at least one non digit # followed … Continue reading How to Split a string every time it reaches 4 digits using regular expressions in php

How to check if related model exists in Laravel

Published on

since @TheShiftExchange did not take the advice, there we go with generic solution working on all the relation types: if (count($model->relation)) { // exists} This will work for every relation since dynamic properties return Model or Collection. Both implement ArrayAccess. So it goes like this: single relations: hasOne / belongsTo / morphTo / morphOne // … Continue reading How to check if related model exists in Laravel

How to Redirect All Requests To HTTPS in Laravel

Published on

Using App::before You might be able to take advantage of the App::before() block in the app/filters.php file. Change the block to include a simple check to see if the current request is secure, and if not, redirect it. App::before(function($request) { if(! Request::secure()) { return Redirect::secure(Request::path());}}); Using Filters Another option might be to create a filter … Continue reading How to Redirect All Requests To HTTPS in Laravel

How to place HTTPS on my app in laravel 5 rather than .htaccess

Published on

Make it works with a Middleware class. Let me give you an idea. namespace MyApp\Http\Middleware; use Closure; class HttpsProtocol { public function handle($request, Closure $next) { if (!$request->secure() && env(‘APP_ENV’) === ‘prod’) { return redirect()->secure($request->getRequestUri());} return $next($request);}} Then, apply this middleware to every request adding setting the rule at Kernel.php file, like so: protected $middleware … Continue reading How to place HTTPS on my app in laravel 5 rather than .htaccess