Categories
Book Study Recommendation Books

What’s New in PHP 8 ?

Union types

public function foo(Foo|Bar $input): int|float;

The nullsafe operator

$dateAsString = $startDate ? $startDate->asDateTimeString() : null;

$dateAsString = $booking->getStartDate()?->asDateTimeString();

New mixed type

function bar(): ?mixed {}

Throw expression

$triggerError = fn () => throw new MyError();

$foo = $bar[‘offset’] ?? throw new OffsetDoesNotExist(‘offset’);

READ -> https://stitcher.io/blog/new-in-php-8

Categories
Book Study Recommendation Books

Amazing Article ! Why I quit my job !

Amazing article wrote by https://twitter.com/brendt_gd

https://stitcher.io/blog/dont-get-stuck

Categories
API

What HTTP status response code should I use if the request is missing a required parameter?

The 422 (Unprocessable Entity) status code means the server understands the content type of the request entity (hence a 415(Unsupported Media Type) status code is inappropriate), and the syntax of the request entity is correct (thus a 400 (Bad Request) status code is inappropriate) but was unable to process the contained instructions. For example, this error condition may occur if an XML request body contains well-formed (i.e., syntactically correct), but semantically erroneous, XML instructions.

https://stackoverflow.com/questions/3050518/what-http-status-response-code-should-i-use-if-the-request-is-missing-a-required

Categories
Laravel

How to send email via Laravel ?

Create Mailgun account

https://app.mailgun.com/app/dashboard

Update .env

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=587
MAIL_USERNAME=XXXXXXXXXXXXXXXXXXXXX
MAIL_PASSWORD=XXXXXXXXXXXXXXXXXXXXX

Clear Cache

php artisan config:cache

Categories
Laravel Technical

Flash Messaging With Vue

EPISODE 29 RUN TIME 13:59 • Apr 25th, 2017

https://laracasts.com/series/lets-build-a-forum-with-laravel/episodes/29

One of the most important topic a full stack developer should know. This topic will help you to quickly provide quick feedback to your customer within your application

https://forum.raleche.com

Categories
Book Study Recommendation Business alignment with IT

Stop Promoting Incompetent Leaders

There are too many incompetent men in leadership positions — in large part because businesses tend to promote people on the basis of charisma, confidence, and even narcissism. Instead, companies should be putting people in charge who demonstrate competence, humility, and integrity. If you’re responsible for assessing leadership candidates, you should work on your ability to distinguish between confidence and competence. Remember that overconfidence is a natural result of privilege, which is often linked to gender. Fortunately, you can use scientifically valid assessments to measure the traits you want (or don’t want) in your leaders. You can ask company leaders, including emerging leaders, to take self-assessments, and then measure their responses against their leadership style, performance, and effectiveness. The resulting data will help identify patterns that characterize good and bad leaders at your company. Of course, this practice will take time and effort, and many organizations won’t want to invest those resources. But vetting candidates for leadership roles will pay dividends down the line.

How to Spot an Incompetent Leader,” by Tomas Chamorro-Premuzic

Categories
Laravel

Laravel redirect with message

Redirecting With Flashed Session Data

Redirecting to a new URL and flashing data to the session are usually done at the same time. Typically, this is done after successfully performing an action when you flash a success message to the session. For convenience, you may create a RedirectResponse instance and flash data to the session in a single, fluent method chain:

Route::post('user/profile', function () {
    // Update the user's profile...

    return redirect('dashboard')->with('status', 'Profile updated!');
});

After the user is redirected, you may display the flashed message from the session. For example, using Blade syntax:

@if (session('status'))
    <div class="alert alert-success">
        {{ session('status') }}
    </div>
Categories
Laravel

Laravel Generate Authentication Page

It is very easy to generate authentication page with laravel. All you have to do is to execute the following commands

composer require laravel/ui 
php artisan ui vue --auth

And you will find all the view blade files within this directory

resources/views/auth
Laravel Authentication page
Laravel Authentication page composer require laravel/ui php artisan ui vue –auth

Categories
Laravel

Customize your error pages with Laravel

Easy commands to generate template error pages that Laravel is using, see below

php artisan vendor:publish –tag=laravel-errors

Categories
Technical

CSS helper – Themify

This library Themify is so useful ! Please go ahead and use it

below find an example of icons

themify useful web icons
themify useful web icons