Laravel basic Functions, eloquent cruds, query filters, constants

Overview

Emmanuelpcg laravel-basics

Stars GitHub license Latest Stable Version Total Downloads

Description


Package with basic starter features for Laravel.

Install

composer require emmanuelpcg/laravel-basics

If Builder

Creates an eloquent builder that checks a condition to be executed

In app/providers/AppServiceProvider.php add:

public function register()
{
    BuilderQueries::builderIf();
}

without operator param:

$cars = Cars::where('color', 'red')
        ->if(auth()->check(), 'color', 'blue')
        ->get();

with operator param:

$cars = Cars::where('color', 'red')
        ->if(auth()->check(), 'color', '!=', 'red')
        ->get();

Constants

creates an object with extra features of the constants:

1, "SPORT" => 2 ] */ CarTypes::getValues(); /** [1, 2] */ CarTypes::toSelectOptions(); /** [ [ 'value' => 1, 'text' => "MUSCLE" ], [ 'value' => 2, 'text' => "SPORT" ] ] */ ">
class CarTypes extends Constants
{
    const MUSCLE = 1;
    const SPORT = 2;
}


CarTypes::getConstants();

/**
[
    "MUSCLE" => 1,
    "SPORT" => 2
 ]
*/

CarTypes::getValues();

/** [1, 2] */

CarTypes::toSelectOptions();

/**
[
    [
        'value' => 1,
        'text' => "MUSCLE"
    ],
    [
        'value' => 2,
        'text' => "SPORT"
    ]
]
*/
You might also like...
A package for Laravel to perform basic git commands on locally integrated packages.

A package for Laravel to perform basic git commands on locally integrated development packages. If working within multiple local development packages or repositories at once this package is meant to ease the burden of navigating to each individual repository to perform basic git commands.

Laravel basic repository integration

WekodeRepository This is a package to easely integrate a repository pattern with the needed service provider and all the necessary basic functions Ins

Simple Arabic Laravel Dashboard , has basic settings and a nice layout . to make it easy for you to create fast dashboard
Simple Arabic Laravel Dashboard , has basic settings and a nice layout . to make it easy for you to create fast dashboard

Simple Arabic Laravel Dashboard ✅ Auto Seo ✅ Optimized Notifications With Images ✅ Smart Alerts ✅ Auto Js Validations ✅ Front End Alert ✅ Nice Image V

A suit of basic files samples to build a light-weight , short-handed & a strong Laravel REST API Applications.

Concerning Laravel. I found myself repeating a very basic form of code each time i begin a new REST API. in which the whole Interface's pieces are dev

Helps automate a basic robots.txt for Laravel 5.x & 6

Laravel 5 & 6 robots.txt helper with meta blade directive An automatically generated robots.txt which automatically discourages indexing of folders, w

A Laravel wrapper for spatie/dns. Allows to query and validate DNS records.

A Laravel wrapper for spatie/dns. Allows to query and validate DNS records.

Update multiple Laravel Model records, each with it's own set of values, sending a single query to your database!

Laravel Mass Update Update multiple Laravel Model records, each with its own set of values, sending a single query to your database! Installation You

A package to filter laravel model based on query params or retrieved model collection

Laravel Filterable A package to filter laravel model based on query params or retrived model collection. Installation Require/Install the package usin

Use Laravel's built-in ORM classes to query cloud resources with Steampipe.
Use Laravel's built-in ORM classes to query cloud resources with Steampipe.

Laravel Steampipe Use Laravel's built-in ORM classes to query cloud resources with Steampipe, an open source CLI to instantly query cloud APIs using S

Releases(v0.4.2)
Owner
Emmanuel Pereira Pires
Emmanuel Pereira Pires
This package was created to deal with laravel datatables and cruds using vuejs.

datatable-cruds Installation This package was created to deal with laravel datatables and cruds using vuejs. Install the package through Composer. Run

Osama Saad 9 Dec 19, 2022
🖖Repository Pattern in Laravel. The package allows to filter by request out-of-the-box, as well as to integrate customized criteria and any kind of filters.

Repository Repository Pattern in Laravel. The package allows to filter by request out-of-the-box, as well as to integrate customized criteria and any

Awes.io 160 Dec 26, 2022
Need some filters? This package is based on the Repository Design Pattern to let you create specific queries easily.

DevMakerLab/Laravel-Filters Need some filters? This package is based on the Repository Design Pattern to let you create specific queries easily. Insta

DevMakerLab 19 Feb 20, 2022
Shell script for Git module deployment with include/exclude filters.

Deploy multiple Git repositories in an unique folder modgit is a shell script for deploying multiple Git repositories in root folder of any project, w

Johann Reinké 175 Nov 22, 2022
A collection of easy-to-use filters with clause conditions to Filament

Filament Advanced Filter A collection of easy-to-use filters with clause conditions to Filament Installation Install the package via composer (require

Webbing Brasil 45 Jan 2, 2023
Provides a Eloquent query builder for Laravel or Lumen

This package provides an advanced filter for Laravel or Lumen model based on incoming requets.

M.Fouladgar 484 Jan 4, 2023
A MongoDB based Eloquent model and Query builder for Laravel (Moloquent)

Laravel MongoDB This package adds functionalities to the Eloquent model and Query builder for MongoDB, using the original Laravel API. This library ex

Jens Segers 6.3k Jan 7, 2023
A DynamoDB based Eloquent model and Query builder for Laravel.

Laravel DynamoDB A DynamoDB based Eloquent model and Query builder for Laravel. You can find an example implementation in kitar/simplechat. Motivation

Satoshi Kita 146 Jan 2, 2023
Laravel router extension to easily use Laravel's paginator without the query string

?? THIS PACKAGE HAS BEEN ABANDONED ?? We don't use this package anymore in our own projects and cannot justify the time needed to maintain it anymore.

Spatie 307 Sep 23, 2022
Laravel Query Helper was developed for laravel 7.2+ to help you optimize sql queries

Laravel Query Helper Laravel Query Helper was developed for laravel 7.2+ to help you optimize sql queries, this package will contain all advanced SQL

Syrian Open Source 15 Nov 20, 2022