Hello developers.

Today I will show you how to make a sortable column dynamic without Frontend. When you write Restful API and you have a table that must be sort dynamically you can’t do that without Frontend. This problem occurred when you want to do drag and drop functionality over the REST API. If you have many columns you can’t get all columns and can’t do that.

For this problem have a package for doing that. Then I show how to fix this problem:)

Install

Install package through Composer

composer require rutorika/sortable

Sortable Trait

Adds sortable behavior to Eloquent (Laravel) models

Usage

Add position


Hello everyone. Today we check a new package for how to use it.

This package provides a trait that adds sortable behaviour to an Eloquent model.

The value of the order column of a new record of a model is determined by the maximum value of the order column of all records of that model + 1.

The package also provides a query scope to fetch all the records in the right order.

Spatie is a web design agency in Antwerp, Belgium. You’ll find an overview of all our open source projects on our website.

Installation

This package can be installed…


Hello everyone. In this article, I will show you how to generate an Eloquent Model from a database table. For this process, we need to install eloquent-model-generator.

Step 1. Add Eloquent Model Generator to your project:

composer require krlove/eloquent-model-generator --dev

Step 2. Register GeneratorServiceProvider:

'providers' => [
// ...
Krlove\EloquentModelGenerator\Provider\GeneratorServiceProvider::class,
];

If you are using Laravel version 5.5 or higher this step can be omitted since this project supports Package Discovery feature.

Step 3. Configure your database connection.

After installation, we can use the Use

php artisan krlove:generate:model User

to generate a model class. Generator will look for table with…


Hello everyone. Today I will show you how to make Eloquent relations with the MySQL JSON column. This Laravel Eloquent extension adds support for JSON foreign keys to BelongsTo, HasOne, HasMany, HasOneThrough, HasManyThrough, MorphTo, MorphOne and MorphMany relationships.
It also provides many-to-many relationships with JSON arrays.

For that first, we need to install Eloquent Json Relations package.

composer require staudenmeir/eloquent-json-relations:"^1.1"

One-To-Many Relationships

In this example, User has a BelongsTo relationship with Locale. There is no dedicated column, but the foreign key (locale_id) is stored as a property in a JSON field (users.options):

class User extends Model { use \Staudenmeir\EloquentJsonRelations\HasJsonRelationships; protected $casts =…

Laravel auto backup database and source code | 2021

Hello everyone. Today I will show you how to backup your laravel project’s database or project’s source code to a local or remote server easyly.

First of all, you need to install laravel-backup package to the project. You can install this package via composer using:

composer require spatie/laravel-backup

The package will automatically register its service provider.

To publish the config file to config/backup.php run:

php artisan vendor:publish --provider="Spatie\Backup\BackupServiceProvider"

Hello everyone. Today I will talk about laravel migrations. You know laravel works with that.

  1. You create migration with command
  2. write table columns with laravel migration methods.
  3. migrate your migrations to the database

But with this package you able to create a database firstly or your DA creates database tables and next you create migrations from SQL tables. For that, you can use migration generator package.

Firstly you must install a package with the composer.

composer require --dev "xethron/migrations-generator"

In Laravel 5.5 the service providers will automatically get registered.

In older versions of the framework edit config/app.php


Hello everyone. Today I will share my last research with you about programming languages. Today approximately 700+ programming languages available in the web development sphere. Some of these are used only for specific use-cases, but others using for web application development.

If you planning to learn a new language for this year or researching the perspective of programming languages keep reading.

1. Python

Python is one of the fastest-growing languages out there. Python has web development frameworks are the most mainstream framework tools offered by Python.

The best thing about Python is that being a high-level language, it is easy to learn…


Hello everyone. In this post, I will talk about how to write passwordless login in your Laravel application. You will create a temporary route and send it to someone. Who clicks this link will be login to the application.

This package provides a temporary signed route that logs in a user. What it does not provide is a way of actually sending the link to the route to the user. This is because I don’t want to make any assumptions about how you communicate with your users.

Firstly you must install this package.

composer require grosv/laravel-passwordless-login

After installation, you configure…


Hi everyone. In this blog, I will show you how to make localization in databas for different tables and contents.

For that have many different ways. But in Laravel have a package laravel-translatable for that. I will show you how to use this package in your project in a good way. The main idea of this package you can use a trait in your model to translate your model. How? I will show now))

This package contains a trait to make Eloquent models translatable. Translations are stored as JSON. There is no extra table needed to hold them.

First of…


Hi everyone. In this post, I will tell you how to build and deploy to server your Laravel project with docker.

Firstly I want to write about Laravel deployer. Laravel deployer is a package for using to deploy Laravel project to server. This package has many futures. Deployer must create your code versions and you can be back to the previous version. I share thelist of futures.

  • Simple setup process
  • Zero downtime deployments
  • Ready-to-use tasks for Laravel
  • Choose your deployment strategy
  • Agentless, it’s just SSH
  • Did something go wrong? Rollback to the previous release
  1. Firstly you must install a package…

Tony Stark

I am iron man

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