Download the PHP package crocodic/laravel-model without Composer

On this page you can find all versions of the php package crocodic/laravel-model. 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 laravel-model

Crocodic Laravel Model

An alternative laravel eloquent. Crocodic Laravel Model using Model, Repository and Service pattern. Model is a class that define anything about table columns. Repository is a class that define your own query method. And Service is a class that should define your own business logic query method.

Requirement

Laravel / Lumen 5. | 6. | 7. | 8.

Install Command

composer require crocodic/laravel-model

LUMEN USER:

after install with the composer then add this bellow to /bootstrap/app.php at section Register Service Providers

$app->register(\Crocodic\LaravelModel\LaravelModelServiceProvider::class);

1. Create a model

Create a model from a table
php artisan create:model foo_bar_table

Create model for all tables
php artisan create:model

Create a model with other connection
php artisan create:model foo_bar_table --connection=con2

I assume that you have a table with the structure like bellow:

It will create a new model class file at with the following file structure :

Also create a new Repository class file, and a new Service class file. /app/Repositories/Books.php /app/Services/BooksService.php

You can set custom connection, table and primary key name

2. Using Crocodic Laravel Model class on your Controller

Crocodic Laravel Model use Model, Repository and Service pattern. If you want make a query, please use the Repository one instead of Model Class. Like example bellow: Insert at top of your controller class name.

3. Using Crocodic Laravel Model class that has a relation

I assume you have a table for book relation like bellow :

and your book structure to be like bellow:

Now you have to create a model for table, you can following previous steps.

I assume that you have create a model, so make sure that now we have two files in the

Open the Books model , and add this bellow method

Then open the FooController

As you can see now we can get the category name by using without any SQL Query or even Database Builder syntax. Also you can recursively go down to your relation with NO LIMIT.

4. How to Casting DB Builder Collection output to Crocodic Laravel Model Class?

You can easily cast your simple database builder collection to cb model class.

5. How to insert the data with Crocodic Laravel Model

You can easily insert the data with method like bellow:

Then if you want to get the last insert id you can do like bellow:

5. How to update the data with Crocodic Laravel Model

You can easily update the data, just find it for first :

5. How to delete the data?

You can easily delete the data, just find it for first :

or

Model Method Available

A One-To-Many Relationship

A One-To-One Relationship

Other Useful

  1. CRUDBooster Laravel CRUD Generator

All versions of laravel-model with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2
doctrine/dbal Version ^2.10
illuminate/support Version ^5.7|^6.0|^7.0|^8.0
illuminate/console Version ^5.7|^6.0|^7.0|^8.0
illuminate/database Version ^5.7|^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 crocodic/laravel-model contains the following files

Loading the files please wait ....