Moh

Setting Up SSH Connection between Ubuntu 22 and GitHub: A Step-by-Step Guide

To make an SSH connection between Ubuntu 22 and GitHub, you can follow these steps: 1. Generate an SSH key pair: run the following command to generate an SSH key pair:   ssh-keygen -t ed25519 -C “[email protected]”   Replace `”[email protected]”` with your actual email address. You can also choose a different key type (e.g., RSA) […]

Setting Up SSH Connection between Ubuntu 22 and GitHub: A Step-by-Step Guide Read More »

Best Practices: Running ‘apt update’ and ‘apt upgrade’ for Package Management

The `apt update` and `apt upgrade` commands are commonly used in package management on Debian-based systems like Ubuntu. Here’s what each command does: 1. `apt update`: This command updates the local package index. It retrieves the latest information about available packages from the software repositories configured on your system. Running `apt update` ensures that your

Best Practices: Running ‘apt update’ and ‘apt upgrade’ for Package Management Read More »

Getting the ID of a Newly Inserted Record in Laravel using save() Method

In Laravel, you can get the ID of a newly inserted record after calling the `save()` method on an Eloquent model by accessing the `id` property of the model. Here is an example:  // Create a new User model instance$user = new AppModelsUser;// Set some attributes on the model$user->name = ‘John Doe’;$user->email = ‘[email protected]’;// Save

Getting the ID of a Newly Inserted Record in Laravel using save() Method Read More »

Laravel Unique Validation on Multiple Columns

Let’s discuss this example:    ‘username’ => [ ‘required’, Rule::unique(‘users’) ->where(‘company_id’, $this->company_id) ] The code you provided is defining validation rules for the ‘username’ field in a Laravel application. The first rule ‘required’ means that the field is mandatory and must have a value. The second rule ‘Rule::unique’ is a dynamic rule that checks for

Laravel Unique Validation on Multiple Columns Read More »

Laravel Sanctum in Shorthand

Laravel Sanctum is a package that provides a lightweight authentication system for single-page applications (SPA), mobile applications, and simple, token-based APIs. As of the latest version of Laravel (8.x) which includes Sanctum (2.x), it provides the following methods: Auth::user() – Retrieves the currently authenticated user. Auth::id() – Retrieves the ID of the currently authenticated user.

Laravel Sanctum in Shorthand Read More »

Fixing SSH key: [email protected]: Permission denied (public key) with GitHub

Once your SSH key has been generated on the server, you should add it to the SSH agent: $ eval “$(ssh-agent -s)” > Agent pid 59566 $ ssh-add ~/.ssh/yourKeyName SSH-agent is a program that manages SSH keys for secure authentication when logging into remote servers. When you add a new key to ssh-agent, you are

Fixing SSH key: [email protected]: Permission denied (public key) with GitHub Read More »