It is frustrating to see cURL error 60: SSL certificate problem: self signed certificate in certificate chain error while calling external APIs from your PHP project. Well, the fix is easy. But, sometimes, especially when multiple PHP versions are available in WampServer, extra care should be taken to install it correctly. Follow along:

  1. Download the latest cacert.pem file.
  2. Move the file to the desired location. I keep it inside the wamp64 folder. The path to the file is D:/wamp64/cacert.pem
  3. Now we need to add this path in php.ini files located in different folders.
  4. Left-click the wampserver icon in the system…

You may be working locally with the Laravel project; scaffolded a front-end app with React/Vue/Angular and when making requests to routes wrapped within auth:sanctum middleware, you may get an unauthenticated error. It is because of misconfigurations. Let’s fix this.

  • Make sure the laravel app is serving from localhost (127.0.0.1) by doing the good old php artisan serve. Do not use virtual hosts because you cannot serve the front-end apps from the same virtual host.
  • Check the port numbers of your front-end app. Usually, React app serves at http://localhost:3000 and Vue app serve from http://localhost:8080.
  • It is necessary for the front-end…


Before you start adding push notifications functionality in your Flutter app, please go through these two resources.

Setting up and fixing possible errors

Import the package https://pub.dev/packages/firebase_messaging into your Flutter app. Go through each and every installation step. You may run into few errors here when running the app.

  1. The first error could be in your Application.java file. Make sure the IDE doesn’t give any warning signs. If there are no warning signs, then there is no need to change. If it does at this line, consider changing the registerWith method as below.
// The error lineFlutterFirebaseMessagingService.setPluginRegistrant(this);

As of this writing, you need to…


  1. Install Sanctum ```composer require laravel/sanctum```
  2. Publish the config file and migration ```php artisan vendor:publish — provider=”Laravel\Sanctum\SanctumServiceProvider”```
  3. We do not need to make any changes to the config file but we need to run the migrations. ```php artisan migrate```
  4. First, you need to expose an endpoint to register the users and save the details in the users table (Or any other table you prefer.) Usually, the endpoint would be /api/register if you are writing the routes in the api.php file. If you are building the API, you may not use the default authentication scaffolding by laravel. That’s fine. …


I have recently added Quill JS to one of my Laravel projects. I made a JSON column to save the details.

// migration
$table->json('syllabus')->nullable();

The installation is straight forward. Just get the CSS and JS of Quill and import in the page you need. Since I only use in two places of the application. I used sections to add them.

@section('styles')
<link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet">
@endsection
@section('scripts')
<script src="https://cdn.quilljs.com/1.3.6/quill.js"></script>
@endsection

I need it to edit the contents and also display the contents. So I have created a Vue component.

Fixing the insert is null error

Quill saves the details in a JSON object. Whenever there is…


You may encounter this error while upgrading to Laravel 7. Most of the things in the upgrade guide are very straight forward but the Exception handling section is what causes this issue mostly.

Your Exception.php file should be like this

<?phpnamespace App\Exceptions;use Throwable;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
class Handler extends ExceptionHandler
{
// use Throwable - you should NOT import Throwable class as a trait here. You need to just import it above the class
public function report(Throwable $exception)
{
parent::report($exception);
}
public function render($request, Throwable $exception)
{
return parent::render($request, $exception);
}
}


Note: I have originally written this post on Coder Bootcamp for absolute beginners and is a part of the free full-stack curriculum. This post guides you on what to learn first to build your first webpage and expects a self-learning approach. It uses handpicked Mozilla documentation references more.

About the project

The foundation project helps you get started with the front-end. You will know about browser technologies and how to build websites with HTML and CSS. It is better to work on a simple project like your resume or your family details. You can check some of the project ideas here.

End goal

You should…


If you have followed the docs and see this error two things you should do…

1. Creating Procfile correctly

The docs ask us to execute this command

// Do not do this
echo "web: vendor/bin/heroku-php-apache2 public/" > Procfile

Remember, you need to remove those quotes when executing from the command prompt. The exact line is

// Execute this
echo web: vendor/bin/heroku-php-apache2 public/ > Procfile

And do check the name of the file, it should start with p in uppercase: Procfile

2. Checking the branch

If you are not on the local master branch while deploying the code to Heroku, you will end up with the errors.

You need…


MSG91 is the SMS service provider I am using for Craypolar. It is a really great service and should definitely consider for your projects if you have an sms use case.

I assume you have set up the API and sending the messages and this article focuses on how to receive delivery reports.

  1. Set up a route in your web.php Remember it should be POST request.
Route::post('messages-activity/delivery-report', 'DeliveryReportController@index');

2. In your MSG91 panel, add the full route in webhooks input.

3. Get the delivery report data sent by MSG91 in your controller

// DeliveryReportController.phppublic function index(Request $request)
{
$data = $request->all();
$items = json_decode($data['data'], true); foreach ($items as $item) {
// do all that you want
}
}


Instead of using a validator, you can send custom JSON error responses in Laravel. If you are using axios library, the catch() method will grab the response.

if ($some_check_here) {
return response()->json([
'errors' => [ 'contact_type' => [ 'You must give either valid email or phone number' ] ] ], 422);
}

Ravi Teja

Full stack developer. Entrepreneur.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store