Escolar Documentos
Profissional Documentos
Cultura Documentos
Overview
Scaffold Interface is a Laravel package designed to speed up your web development process. Thanks to its
powerful CRUD Generator that support all types of tables relationships, and its admin control panel
shipped with a built-in User Management System.
Features
Generate your models,views,controllers and migrations just in a few clicks.
Views scaffolding support Bootstrap and Materialize css.
Generate (OneToMany,ManyToMany) relationships including views and controllers.
Websockets using Pusher Noti cations (https://www.github.com/pusher).
AdminLTE dashboard template with users management system (users-roles-permissions) using
laravel-permission (https://github.com/spatie/laravel-permission).
Softdeletes and timestamps.
A delete con rmation message.
Using an interface to design your table.
Rollback possibility.
Prerequisites
PHP >=5.6
Scaffold-Interface version
v5.1
v1.4.11 or less
v1.5.*
I. Package installation
1. Add the package to your dependencies in composer.json:
require:{
"Amranidev/scaffoldinterface":"v1.6.*"
}
2. update composer:
$composerupdate
6. Authentication scaffolding:
$phpartisanmake:auth
II. Usage
Go to http://{yourprojecturl}/scaffold .
Click on new table and ll the form, then click on ready and done.
III. Relationships
1. OneToMany
This package provides a simple short way to generate OneToMany relationship.
We could use our previous example Product entity.
So lets create a new entity called Command .
Before ending creation, click on OneToMany button, choose product table, choose associated eld and click
on OneToMany Button again to be con rmed.
This will create a model with relation methods ,views, controller and migration le containing
foreignkeys, for sure you can change whatever you want.
Then click on migration button.
2. ManyToMany
To generate ManyToMany relationship between tow tables, click on ManyToMany button, choose tables
via combobox (table1,table2) then click on create.
Well, this will create a new pivot table schema ready to be migrated adding ManyToMany raltionship
methods to models.
This doesn't create views,controllers and routes, because we belive that each web artisan has his own
unique methodology.
$user=new\App\User();
$user>name="johndoe";
$user>email="jhondoe@example.com";
$user>password=Hash::make("password");
$user>save();
(../img/doc8.png)
(../img/doc9.png)
(../img/doc10.png)
You can determine if a user has a certain role:
$user>hasRole('writer');
You can also determine if a user has any of a given list of roles:
$user>hasAnyRole(Role::all());
What is pusher ?
Pusher is a hosted service that makes it super-easy to add real-time data and functionality to web and
mobile applications.
Pusher sits as a real-time layer between your servers and your clients. Pusher maintains persistent
connections to the clients - over WebSocket if possible and falling back to HTTP-based connectivity - so
that as soon as your servers have new data that they want to push to the clients they can do, instantly via
Pusher.
Pusher offers libraries to integrate into all the main runtimes and frameworks. PHP, Ruby, Python, Java,
.NET, Go and Node on the server and JavaScript, Objective-C (iOS) and Java (Android) on the client.
Pusher is a highly scalable real-time solution established in 2010 and has lots of awesome customers
including GitHub, MailChimp, CodeShip, The Financial Times, UserVoice, Travis CI and QuizUp.
Before we get started, you have to create a pusher account.
Please sign up for a free Pusher account via pusher.com/signup (https://pusher.com/signup), and create a
new app via Pusher dashboard.
Con guration.
Go to .env and de ne (app_id,key,and secret)
PUSHER_APP_ID=your_app_id
PUSHER_KEY=your_key
PUSHER_SECRET=your_secret
'connections'=>[
'main'=>[
'auth_key'=>env('PUSHER_KEY'),
'secret'=>env('PUSHER_SECRET'),
'app_id'=>env('PUSHER_APP_ID'),
'options'=>[],
'host'=>null,
'port'=>null,
'timeout'=>null,
],
Backend
So when you create a new entity, the package creates back-end pusher noti cation code automatically
behind the scenes.
Check the Entity Controller, we took our previous example, Product entity.
Frontend
The fornt end code was already de ned in resources/views/scaffold-interface/layouts/app.blade.php.
Contribution
Contribution
Any ideas are welcome. Feel free to submit any issues or pull requests.
Follow me
Twitter :
Follow
50
(https://twitter.com/amranidev)
GitHub :
Follow
11
(https://github.com/amranidev)