Download the PHP package schrosis/blade-sql without Composer

On this page you can find all versions of the php package schrosis/blade-sql. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package blade-sql

blade-sql

blade-sql-test


Introduction

blade-sql provides the generation and execution of SQL using Blade, Laravel's template engine

When you want to write a complex SQL with more than 100 rows, isn't it hard to write it in the query builder?
Sometimes you want to write raw SQL for tuning purposes
In such cases, blade-sql is useful!

Requirements

Installation

Laravel uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider

If you don't use auto-discovery, add the BladeSQLServiceProvider to the providers array in config/app.php
And if you use facade aliases, add BladeSQL to the aliases array

Copy the package config to your local config with the publish command

Usage

Create .blade.php file for blade-sql in resources/sql/ dir

Execute SELECT Query

Execute a query using the BladeSQL facade

The result of a select query is a Collection object of stdClass

You can also turn it into a Collection object of Models or your Entity

The entity method argument expects a class with a method named fromArray
Otherwise, you can use the Collection::map()

Execute INSERT UPDATE DELETE Query

You can also use the BladeSQL facade to perform an insert update delete query

The way to call these methods is the same as the select
The difference is that these methods return the number of rows that have been updated

Run on a specific connection

If you want to use a connection other than the default one, call the setConnection method

Also use it when doing a transaction

Blade Directives and Components

In addition to the basic features of blade, provides directives and components similar to Java's mybatis

@where

Erase the leading AND or OR and prefix it with WHERE

@where component is useful when using @if to create WHERE clauses

It will compile like this

If the $slot of @where is empty, the first WHERE is not attached

@set

Works just like @where
Remove the , at the end and prefix it with SET

@set component is useful when using @if to create a SET clause for an update query.

It will compile like this

@IN

@IN directive Create an IN clause from an array

If $id_list is [1, 2, 3], it will be compiled like this

@LIKE

@LIKE directive escapes values that are bound to the LIKE clause

If $name is 'strawberry 100%', then it will compile like this

And 'strawberry 100%' will be escaped to 'strawberry 100\%'

You can also easily add _ and %


All versions of blade-sql with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3|^8.0
ext-pdo Version *
laravel/framework Version ^6.0|^7.0|^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package schrosis/blade-sql contains the following files

Loading the files please wait ....