アプリ関連ニュース

Advantages of Laragon

Laragon is a program that provides the WAMP environment (which stands for Windows, Apache, MySQL and PHP) and can completely replace XAMPP which has many current bugs. With Laragon, we can easily, quickly and conveniently set up the WAMP environment and manage them in local environment.

In addition to supporting PHP and MySQL, Laragon also supports other web programming languages ​​such as Node.js, Python, Java, Go, Ruby and other database management systems like PostgreSQL, MongoDB. This software suite is extremely popular in the Laravel community, downloaded and loved by thousands of programmers around the world.

XAMPP and WAMP

Before talking about Laragon, I would like to first go through my development web server history. First, I always used Windows-based computers for all my development work. When I was starting, the only viable solutions for Windows development was to set everything manually or to use XAMPP or WAMP server software. For a while, I used WAMP, but for the most part, XAMPP was my preferred environment. And I had different versions of XAMPP installed until recently, each one with varying versions of PHP.

Laragon will allow switch between PHP versions, using Apache and Nginx, and maybe having support for different MySQL versions. Laragon is not easy to use as Local, but once we set it up, it is working as we expect it to. Most operations are done via the context menu for the application sitting in the taskbar notifications area.

The following are the benefits of laragon.

— PHP version support

— CMDER terminal support

— Laragon provides us a strong database management system with HeidiSql, optionally you can change it for phpmyadmin

— SSL activation

— Choosing Apache, Nginx for your web server

— Activating Memcache, Redis

— Quick app creating with GUI application

— Changing ports very quickly and easily

— Sharing your local site for the public with Ngrok on laragon

— Email management

— Powerful universal development environment for PHP, Node.js, Python, Java, Go, Ruby. It is fast, lightweight, easy-to-use and easy-to-extend

By Tsuki



DataTablesを使用したテーブル生成とサーバーサイド連携(3)

今回はDataTablesを使用したテーブル生成方法とサーバーサイド連携方法をシェアしたいと思います。
前回の記事「DataTablesを使用したテーブル生成とサーバーサイド連携(2)」で作成した動作確認用のスクリプトを実行して動作確認をおこないます。

続きを読む

Windows11でAndroidアプリが使える機能のプレビュー開始

アメリカでWindows11でAndroidアプリが利用可能になる
Amazon Appstoreのプレビューの配信が開始されたようです。

https://blogs.windows.com/windowsexperience/2022/02/15/bringing-you-closer-to-what-you-love-with-new-experiences-in-windows-11/

Microsoft Storeを更新することで利用可能になるようです。

一般公開となるのは今年の後半以降になるようですね。
どのくらいのアプリが提供されて、
どのくらいスムーズに動作するのか気になります。
スムーズに動作するのであればSurface等のWindowsタブレットが
実質的にAndroidタブレットとして利用可能になるかもしれませんね。

水曜担当 Tanaka



Some Laravel Tips and Tricks

Today I would like to share some laravel tips and tricks. Let’s take a look.

Use Carbon with Only Hours

If you want to have a current date without seconds and/or minutes, use Carbon’s methods like setSeconds(0) or setMinutes(0).

echo now();

// 2022-02-14 02:12:34

echo now()->setSeconds(0);

// 2022-02-14 02:12:00

echo now()->setSeconds(0)->setMinutes(0);

// 2022-02-14  02:00:00

// Another way – even shorter

echo now()->startOfHour();

Generate Images with Seeds/Factories

Normally, We use Faker to generate fake text values in seeds and factories. But do you know that you can generate not only text values but also Images by Faker?

For example: See image field here – it will generate 100×100 image:

$factory->define(User::class, function (Faker $faker) {

    return [

        ‘name’ => $faker->name,

        ‘email’ => $faker->unique()->safeEmail,

        ‘email_verified_at’ => now(),

        ‘password’ => bcrypt(‘password’),

        ‘remember_token’ => Str::random(10),

        ‘Image’ => $faker->image(storage_path(‘images’), 100, 100)

    ];

});

Simple Pagination

In pagination, if you need just “Previous/next” links instead of all the page numbers (and have fewer DB queries because of that), You can do this easily by changing paginate() to simplePaginate():

// Instead of

$products = Product::paginate(8);

// Now you can do this

$products = Product::simplePaginate(8);

Use @auth in Blade

Instead of an if-statement to check logged-in users, You can use the @auth directive in your blade file.

Old way:

@if(auth()->user())

    // The user is authenticated.

@endif

Latest:

@auth

    // The user is authenticated.

@endauth

The opposite is @guest directive:

@guest

    // The user is not authenticated.

@endguest

Check the view file exists

You can check if the View file exists before actually loading it.

if (view()->exists(‘admin.dashboard’)) {

 // Load the view

}

You can even load an array of views, and only the first existing will be loaded.

return view()->first([‘admin.dashboard’, ‘dashboard’], $data);

Create migration without underscore _ symbol

When you are running a make:migration command, you don’t necessarily have to write underscore _ symbol between parts, like create_users_table.

// with underscore _ symbol

php artisan make:migration create_users_table

You can enter the name into quotes and then utilize spaces instead of underscores.

// without underscore _ symbol

php artisan make:migration “create users table”

Use Auth::once()

Do you know that you c an log in with the user only for One Request? You can easily do this by utilizing the method Auth::once(). No sessions or cookies will be used, which indicates this method may be applicable when building a stateless API.

if (Auth::once($credentials)) {

    //

}

Use @canany to check multiple permissions at once

Earlier, You use the @can directive to check if a user has a certain permission. Now, you can also check multiple permissions at once with the @canany directive.

@canany([‘update’, ‘view’, ‘delete’], $blog)

    // The current user can update, view, or delete the blog post

@elsecanany([‘create’], \App\Blog::class)

    // The current user can create a blog post

@endcanany

This is all for now. Hope you enjoy that.

By Asahi



DataTablesを使用したテーブル生成とサーバーサイド連携(2)

今回はDataTablesを使用したテーブル生成方法とサーバーサイド連携方法をシェアしたいと思います。
本記事は「DataTablesを使用したテーブル生成とサーバーサイド連携(1)」の続きです。

続きを読む

アプリ関連ニュース

お問い合わせはこちら

お問い合わせ・ご相談はお電話、またはお問い合わせフォームよりお受け付けいたしております。

tel. 06-6454-8833(平日 10:00~17:00)

お問い合わせフォーム