teleren/devto huggingface dataset:
Getting Started with the Blazor Barcode and QR Code Generator
Tags: webdev, blazor, dotnet, csharp
Published: 2022-03-25 05:25:06

This video will get you started with the Syncfusion [Barcode Generator component](https://www.syncfusion.com/blazor-components/blazor-barcode) in a Blazor WebAssembly application. You will learn how to generate different barcode types like QR code and data matrix, and how to use other customizations like changing the barcode’s dimension, color, and font. 

Download an example from GitHub: https://github.com/SyncfusionExamples

Refer to the following documentation to learn about the Blazor Barcode Generator component: https://blazor.syncfusion.com/documentation/barcode/getting-started

Check out this online example of the Blazor Barcode Generator component: https://blazor.syncfusion.com/demos/barcodes/default-functionalities

{% youtube CuApVvYbQtI %}
How To Delete Files after Download in Laravel 8
Tags: how, laravel, php
Published: 2022-03-25 05:23:13

Originally posted @ https://codeanddeploy.com visit and download the sample code: https://codeanddeploy.com/blog/laravel/how-to-delete-files-after-download-in-laravel-8

[![Advanced Laravel SAAS Starter Kit with CRUD Generator](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wyjyev8tz3r8vi2w3on1.png)](https://1.envato.market/5g5QAn)

[Advanced Laravel SAAS Starter Kit with CRUD Generator - GET YOUR COPY NOW!](https://1.envato.market/5g5QAn)

In my previous [post](https://codeanddeploy.com/blog/laravel/how-to-download-file-in-laravel-8), I share how to download files in Laravel. Now I will share how to delete your file after downloading. Luckily Laravel 8 already provided a function to delete the file directly after sending it to the user end.


With the help of this function `deleteFileAfterSend(true)` a chaining method for Response class in Laravel 8 our task is done!

 

Below is the complete code on how to use it.


```php
public function download() {
    $path = public_path('for_pro_members.zip');
    $fileName = 'purchase_files.zip';

    return Response::download($path, $fileName, ['Content-Type: application/zip'])->deleteFileAfterSend(true);
}
```

[![Advanced Laravel SAAS Starter Kit with CRUD Generator](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wyjyev8tz3r8vi2w3on1.png)](https://1.envato.market/5g5QAn)

[Advanced Laravel SAAS Starter Kit with CRUD Generator - GET YOUR COPY NOW!](https://1.envato.market/5g5QAn)


I hope this tutorial can help you. Kindly visit here https://codeanddeploy.com/blog/laravel/how-to-delete-files-after-download-in-laravel-8 if you want to download this code.

Happy coding :)
How To Download File in Laravel 8
Tags: laravel, how, php, javascript
Published: 2022-03-25 05:20:38

Originally posted @ https://codeanddeploy.com visit and download the sample code: https://codeanddeploy.com/blog/laravel/how-to-download-file-in-laravel-8

[![Advanced Laravel SAAS Starter Kit with CRUD Generator](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wyjyev8tz3r8vi2w3on1.png)](https://1.envato.market/5g5QAn)

[Advanced Laravel SAAS Starter Kit with CRUD Generator - GET YOUR COPY NOW!](https://1.envato.market/5g5QAn)


In this short post, I'm sharing how to download files in Laravel 8. If have a project like an online digital shop in which users can download files after they purchase then this is for you. We are using a download() function from the Laravel 8 Response class to cater the download.

 

**$filepath** = a path for target file to be download

**$filenam**e = filename for the downloaded file

**$headers** = this is an array about the file content type to download


Response::download($filepath, $filename, $headers)


Now you have a basic idea about this function.
 

We will try to create a route for this.

```php
Route::get('/purchased-download', [\App\Http\Controllers\PurchasedFileController::class, 'download'])->name('purchased.download');
 
```


Then let's write our controller, see the complete code below:

```php
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Response;

class PurchasedFileController extends Controller
{
    public function index()
    {
    	$path = public_path('for_pro_members.zip');
    	$fileName = 'purchase_files.zip';

    	return Response::download($path, $fileName, ['Content-Type: application/zip']);
    }
}
```

[![Advanced Laravel SAAS Starter Kit with CRUD Generator](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wyjyev8tz3r8vi2w3on1.png)](https://1.envato.market/5g5QAn)

[Advanced Laravel SAAS Starter Kit with CRUD Generator - GET YOUR COPY NOW!](https://1.envato.market/5g5QAn)



I hope this tutorial can help you. Kindly visit here https://codeanddeploy.com/blog/laravel/how-to-download-file-in-laravel-8 if you want to download this code.

Happy coding :)
How To Print & Write Array Values to Files in Laravel 8
Tags: laravel, php, mysql, javascript
Published: 2022-03-25 05:17:34

Originally posted @ https://codeanddeploy.com visit and download the sample code: https://codeanddeploy.com/blog/laravel/how-to-print-write-array-values-to-files-in-laravel-8

[![Advanced Laravel SAAS Starter Kit with CRUD Generator](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wyjyev8tz3r8vi2w3on1.png)](https://1.envato.market/5g5QAn)

[Advanced Laravel SAAS Starter Kit with CRUD Generator - GET YOUR COPY NOW!](https://1.envato.market/5g5QAn)


In my previous post, I shared [how to print and write array values in PHP](https://codeanddeploy.com/blog/php/how-to-print-write-array-values-to-files-in-php) now we will do it with Laravel 8 using the **File** class provided by **Laravel**. In this example, we have an animal's array of values. We will loop it and we are using **PHP_EOL** to new line each result and append it to a variable **$contents**.

```php
$contents = '';

$animals = ['Cat', 'Dog', 'Carabao', 'Horse'];

foreach ($animals as $animal) {
    $contents .= $animal.PHP_EOL;
}

File::put('filename.txt', $contents, true);
```

[![Advanced Laravel SAAS Starter Kit with CRUD Generator](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wyjyev8tz3r8vi2w3on1.png)](https://1.envato.market/5g5QAn)

[Advanced Laravel SAAS Starter Kit with CRUD Generator - GET YOUR COPY NOW!](https://1.envato.market/5g5QAn)

I hope this tutorial can help you. Kindly visit here https://codeanddeploy.com/blog/laravel/how-to-print-write-array-values-to-files-in-laravel-8 if you want to download this code.

Happy coding :)
Exception during converting a standalone spring-hibernate based application to web application using Springboot(STS 4)
Published: 2022-03-25 05:16:40



Hi,
  We are trying to convert a standalone spring-hibernate based application to web application using Springboot(STS 4). We are using applicationcontext.xml file for bean creation and configuration.We configured libraries in pom.xml,which is attached here. When running the application using Maven, following error is showing. Please help



Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findPersistenceMetadata(PersistenceAnnotationBeanPostProcessor.java:350)

The following method did not exist:

    org.springframework.beans.factory.annotation.InjectionMetadata.<init>(Ljava/lang/Class;)V

The calling method's class, org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor, was loaded from the following location:

    jar:file:/C:/Users/CIG-Lekshmi1/.m2/repository/org/springframework/spring-orm/2.5.6/spring-orm-2.5.6.jar!/org/springframework/orm/jpa/support/PersistenceAnnotationBeanPostProcessor.class

The called method's class, org.springframework.beans.factory.annotation.InjectionMetadata, is available from the following locations:

    jar:file:/C:/Users/CIG-Lekshmi1/.m2/repository/org/springframework/spring-beans/5.3.16/spring-beans-5.3.16.jar!/org/springframework/beans/factory/annotation/InjectionMetadata.class

The called method's class hierarchy was loaded from the following locations:

    org.springframework.beans.factory.annotation.InjectionMetadata: file:/C:/Users/CIG-Lekshmi1/.m2/repository/org/springframework/spring-beans/5.3.16/spring-beans-5.3.16.jar


Action:

Correct the classpath of your application so that it contains compatible versions of the classes org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor and org.springframework.beans.factory.annotation.InjectionMetadata
How To Print & Write Array Values to Files in PHP
Tags: php, mysql, array
Published: 2022-03-25 05:14:39

Originally posted @ https://codeanddeploy.com visit and download the sample code: https://codeanddeploy.com/blog/php/how-to-print-write-array-values-to-files-in-php

[![Advanced Laravel SAAS Starter Kit with CRUD Generator](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wyjyev8tz3r8vi2w3on1.png)](https://1.envato.market/5g5QAn)

[Advanced Laravel SAAS Starter Kit with CRUD Generator - GET YOUR COPY NOW!](https://1.envato.market/5g5QAn)

In this post, I will share a short and simple code on **how to print and write array values to files in PHP.** If you have a task or problem that needs to write the array value to a file then this is for you. In this example, I'm using **file_put_contents()** to put the value to a file. And **PHP_EOL** to newline after loop the array values.

```php
<?php

$contents = '';

$programmingLanguages = ['PHP', 'PYTHON', 'C#', 'C++'];

foreach ($programmingLanguages as $programmingLanguage) {
    $contents .= $programmingLanguage.PHP_EOL;
}

file_put_contents('filename.txt', $contents, true);

?>
```

[![Advanced Laravel SAAS Starter Kit with CRUD Generator](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wyjyev8tz3r8vi2w3on1.png)](https://1.envato.market/5g5QAn)

[Advanced Laravel SAAS Starter Kit with CRUD Generator - GET YOUR COPY NOW!](https://1.envato.market/5g5QAn)

Thanks for reading. I hope this tutorial can help you. Kindly visit here https://codeanddeploy.com/blog/php/how-to-print-write-array-values-to-files-in-php if you want to download this code.

Happy coding :)
Laravel 9 Multiple Authentication Example using Guard
Tags: laravel
Published: 2022-03-24 18:38:46

In this post we will give you information about Multi Auth Laravel 9 | Multiple Authentication in Laravel 9. Hear we will give you detail about Multi Auth Laravel 9 | Multiple Authentication in Laravel 9 And how to use it also give you demo for it if it is necessary.

To create multi auth in laravel i am using laravel guard. Many web applications need to user and admin management system. That time we need multiple login system like student login, user login, admin login, etc.

Now i am going to show you how we can create these multiple user and admin login systems in laravel. In this tutorial, we’ll use a guard to create this multi authentication system. Laravel default login system, laravel use web as a default guard.

I will use laravel custom guard to manage laravel multiple authentication in laravel 9. If you go to your loginController.php then you can see it use the AuthenticatesUsers trait. So we will see that what is happening here.

If you go to this file which locates this following path

vendor\laravel\framework\src\illuminate\Foundation\Auth\AuthenticatesUsers .php

After going through this file just go to the bottom of this file and you will see a lot of code of the login system. But now we are going to create our own multi-auth system in laravel 9.

Sometimes we need student login, teacher login, and admin login etc. In such kind of situation, we need multi-auth in web applications. Laravel provides an awesome thing to do multi auth using a guard.

So in this example tutorial, I am going to show you how we can create a multi auth system in our laravel 9 application.

[Laravel 9 Multiple Authentication Example using Guard](https://www.codecheef.org/article/laravel-9-multiple-authentication-example-using-guard)
Install and config PostgreSQL on Ubuntu Linux
Published: 2022-03-25 04:49:12

First we need to install PostgreSQL
`sudo apt get install postgresql postgresql-contrib`

Now we check the path for PostgreSQL(for me it is version 12, it might be different for you)
`ls /etc/postgresql/12/main/`

This allows us to check all of the commands available to us
`service postgresql`

This will allow us to check the status
`service postgresql status`

This will log us in as the default user
`sudo su postgres`

Now if we run `psql` we will enter the postgresql cli.

From here, you can run `\l` to see the default databases.

You can also run `\du` to list all of the users.

To change the password of the default user 'postgres', run `ALTER USER postgres WITH PASSWORD 'test123';`

To create a new user:
`CREATE USER nova_glow WITH PASSWORD 'test123';`

Now if we want to give our new user "super" access...
`ALTER USER nova_glow WITH SUPERUSER;`

If You want to remove a user, simply do the following:
`DROP USER user_2;`

If you want to see all of the available commands for psql, you can simply run `man psql` in a new shell.

<u>Note:</u> It is recommended to install `pgadmin` from the software center.
Laravel 8 Logout For Your Authenticated User
Tags: authentication, laravel, javascript, php
Published: 2022-03-25 03:05:08

Originally posted @ https://codeanddeploy.com visit and download the sample code: https://codeanddeploy.com/blog/laravel/laravel-8-logout-for-your-authenticated-user

[![Advanced Laravel SAAS Starter Kit with CRUD Generator](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wyjyev8tz3r8vi2w3on1.png)](https://1.envato.market/5g5QAn)

[Advanced Laravel SAAS Starter Kit with CRUD Generator - GET YOUR COPY NOW!](https://1.envato.market/5g5QAn)


In my previous post, we implement the authentication, now we will talk about **Laravel auth logout**. Logout is one of the important functionality to implement in a web application when users log in they should have an option to log out of their account and secure it.


To shorten this post please follow my previous post here.


## Step 1: Create a route

Navigate **routes/web.php** then put the following code below:

```php
Route::group(['middleware' => ['auth']], function() {
   /**
   * Logout Route
   */
   Route::get('/logout', 'LogoutController@perform')->name('logout.perform');
});
```

## Step 2: Create a LogoutController
Navigate **app/Http/Controllers** directory then create a file called `LogoutController.php` then paste the code below:

```php
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Session;

class LogoutController extends Controller
{
    /**
     * Log out account user.
     *
     * @return \Illuminate\Routing\Redirector
     */
    public function perform()
    {
        Session::flush();
        
        Auth::logout();

        return redirect('login');
    }
}
```
Now you have the logout functionality for your Laravel Authentication. I hope this tutorial can help you. Kindly visit here https://codeanddeploy.com/blog/laravel/laravel-8-logout-for-your-authenticated-user if you want to download this code.

[![Advanced Laravel SAAS Starter Kit with CRUD Generator](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wyjyev8tz3r8vi2w3on1.png)](https://1.envato.market/5g5QAn)

[Advanced Laravel SAAS Starter Kit with CRUD Generator - GET YOUR COPY NOW!](https://1.envato.market/5g5QAn)

Happy coding :)
Laravel 9 Autocomplete Search Example with Typeahead
Tags: laravel
Published: 2022-03-25 04:42:17

There is a simple example of laravel autocomplete typeahead. i am going to write example of how to create autocomplete search using laravel typeahead js. you will see how to we can create laravel typeahead search.

Just follow bellow step to create typeahead with laravel 6, laravel 7, laravel 8 and laravel 9 application.

Bootstrap Typeahead JS provide way of user interface so, we can easily write code of jquery ajax and make it dynamic autocomplete search in laravel application. we can easily use Typeahead JS with bootstrap.

Jquery autocomplete is must if you are dealing with big data, like you have items or products table and thousands of records so it's not possible to give drop-down box, but it is better if we use autocomplete instead of select box.

Follow bellow step to create simple autocomplete search with laravel application.

[Laravel 9 Autocomplete Search Example with Typeahead](https://www.codecheef.org/article/laravel-9-autocomplete-search-example-with-typeahead)
How To Change The Laravel Redirect URL When Not Authenticated?
Tags: laravel, how, php, authenticated
Published: 2022-03-25 04:38:06

Originally posted @ https://codeanddeploy.com visit and download the sample code: https://codeanddeploy.com/blog/laravel/how-to-change-the-laravel-redirect-url-when-not-authenticated

[![Advanced Laravel SAAS Starter Kit with CRUD Generator](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wyjyev8tz3r8vi2w3on1.png)](https://1.envato.market/5g5QAn)

[Advanced Laravel SAAS Starter Kit with CRUD Generator - GET YOUR COPY NOW!](https://1.envato.market/5g5QAn)


In this simple post, I will share with you how to change the Laravel default redirect URL when not authenticated or not log in? The default Laravel installation is the login route named "login" but if you change it it will cause an error when visiting the page with an unauthenticated account. See sample below:

![how-to-change-the-laravel-redirect-url-when-not-authenticated](https://ecn-storage.s3.us-west-2.amazonaws.com/articles/how-to-change-the-laravel-redirect-url-when-not-authenticated-O8yt4QUYR9x980.webp?ctm=1630227459)


To fix this issue when naming your login with a different name we need to update the **Authenticate** class which we can found in this directory **App\Http\Middleware** and you will see this default below:


```php
/**
* Get the path the user should be redirected to when they are not authenticated.
*
* @param  \Illuminate\Http\Request  $request
* @return string|null
*/
protected function redirectTo($request)
{
    if (! $request->expectsJson()) {
        return route('login');
    }
}
```

Next, we will change the **login** to your login name route, mine is "`login.show`".
 

```php
return route('login.show');
```

And after updating the code it will not occur the error when visiting the restricted routes for unauthenticated users.

I hope this tutorial can help you. Kindly visit here https://codeanddeploy.com/blog/laravel/how-to-change-the-laravel-redirect-url-when-not-authenticated if you want to download this code.

[![Advanced Laravel SAAS Starter Kit with CRUD Generator](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wyjyev8tz3r8vi2w3on1.png)](https://1.envato.market/5g5QAn)

[Advanced Laravel SAAS Starter Kit with CRUD Generator - GET YOUR COPY NOW!](https://1.envato.market/5g5QAn)

Happy coding :)
How to limit access to your Internal users with Cloud Run
Tags: gcp, cloudrun
Published: 2022-03-25 03:52:36

Let me explain how to restrict access to Cloud Run other than by your internal users of Google Workspace. It's useful because we do not have to implement any login feature as our server implementation. I used this for our internal admin tool to shutout by external users.

Before you start, you need to setup a load balancer for your Cloud Run service and create OAuth consent screen. Please check [my article](https://dev.to/ku6ryo/add-identity-aware-proxy-to-cloud-run-kee) if you have not set a load balancer up yet and check [Configure the OAuth consent screen](https://developers.google.com/workspace/guides/configure-oauth-consent) to create your OAuth consent screen.

Please go to Identity-Aware Proxy setting. You should see load balancers you have. Turn on IAP for your target load balancer which is connected to your target Cloud Run service.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/azn4wb1c28bcjrkbbqkq.png)

Next, mark as checked the checkbox of the target load balancer. A side panel should show up in the right hand side. Please click the `ADD PRINCIPAL` button.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yaik4g2g4fas8dgni5n0.png)

Then add accounts that you want to let access to your Cloud Run service and set the `IAP-secured Web App User` as the role. Click `SAVE`.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/avgv0592hq3gyenonoom.png)

You should see the `IAP-secured Web App User` section in `Role / Principal` list at the bottom of the right panel.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0n6nfju0omgddwlrukva.png)

Lastly, please make sure that your Cloud Run service requires authentication to access.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m35fnoqlh3ossa6k7092.png)

That's it! Now your Cloud Run service rejects access other than by users with your Google Workspace accounts. The steps are pretty simple but adding principal / role is the step that it's easy to forgot.
Dashy App
Tags: azuretrialhack
Published: 2022-03-08 18:30:30

### Instructions: A basic dashboard which can be used in multi-purpose according to the requirement 


### Overview of My Submission
[Note]: # (Please make sure the project links to the appropriate GitHub repository, and includes the [Apache-2 permissive license](https://www.apache.org/licenses/LICENSE-2.0)  and README.)


### Submission Category: 

Note: #  Wacky Wildcards


### Link to Code on GitHub

link to demo : [link](https://dashyapp.azurewebsites.net/)
link to repository : [link](https://github.com/jay-2000/Dashy)

link: #  `{% https://github.com/jay-2000/Dashy %}`
[Note]: # (Your repository must include a README)
[Note]: # (You must use and list a permissive license for your code: MIT, Apache-2)


### Additional Resources / Info
![preview](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ihzjkvo2jyiv4mhydow6.png)
 
 
[Note:] # Screenshots/demo videos are encouraged!

I hope you liked the blog. If you did, please leave your thoughts in the comments. It would make my day.

Till then, happy 💻 coding! 🍿

You can connect me at [Github](https://github.com/jay-2000) , [Twitter](https://twitter.com/_Jaystwt)
100 días de código: 90, desarrollando una aplicación con MERN
Tags: spanish, 100daysofcode, webdev, beginners
Published: 2022-03-25 03:41:12

¡Hey hey hey!

Hoy he retomado el proyecto con el stack MERN que había dejado de lado para aprender Nextjs y como ha pasado un mes, me he dado cuenta de la importancia de la documentación del software. 

Comencé a retomar lo que ya tenia hecho, poco tiempo hizo falta para que me diera cuenta de que es una suerte que sea poco código porque si fuera mucho realmente no entendería lo que estaba haciendo o por donde iba asi que intentare aprender un poco mas sobre documentación que es un tema que no he tocado mucho.

Hoy he avanzado con el frontend de mi aplicación, creando algunos componentes y haciendo uso de la API REST que tengo desplegué en Heroku para mostrar información y por ahora se ve de la siguiente forma:

![Darito David Alonso Ruiz phonebook aplicacion MERN](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6mvppyz9tto0j684wh30.png)

Pense que seria mas complicado conectar el backend con el frontend pero gracias a [axios](https://www.npmjs.com/package/axios) fue muy sencillo para las peticiones GET.

Deseo comenzar a aprender como realizar peticiones POST con axios para comenzar a crear registros en mi [aplicación de agenda](https://github.com/Darito97/frontend-phonebook) y asi avanzar con el desarrollo.

Espero que tengan mucho éxito con sus proyectos y ¡animo con todo!

Hasta la próxima.