Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding laravel 5.4.* support with Admin LTE Theme #15

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# NVD CRUD Generator
# NVD CRUD Generator for Laravel 5.4.* with Admin LTE support

CRUD generator for Laravel 5.x
CRUD generator for Laravel 5.4.*
- [Screenshots](#screenshots)
- [Features](#features)
- [Installation](#installation)
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "nvd/crud-generator",
"version": "1.0.5",
"name": "arifpavel/crud-generator",
"version": "1.0.0",
"type": "php-library",
"license": "MIT",
"description": "CRUD generator for Laravel 5.x with minimum setup required",
"description": "CRUD generator for Laravel 5.4.x with minimum setup required",
"authors": [
{
"name": "Naveed ul Hassan",
"email": "08es34@gmail.com"
"name": "Arifur Rahman",
"email": "pavelpatiya@gmail.com"
}
],
"require": {
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Crud.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function generateRouteModelBinding()
public function generateRoute()
{
$route = "Route::resource('{$this->route()}','{$this->controllerClassName()}');";
$routesFile = app_path('Http/routes.php');
$routesFile = config('crud.routePath'); // app_path('Http/routes.php');
$routesFileContent = file_get_contents($routesFile);

if ( strpos( $routesFileContent, $route ) == false )
Expand Down
6 changes: 6 additions & 0 deletions src/Config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
* */
'templates' => 'vendor.crud.single-page-templates',

/*
* Defining the route file. (Customization for Laravel 5.4.*)
* You can also use your custom route path here.
* */
'routePath' => base_path().'/routes/web.php',

];

/*
Expand Down
3 changes: 3 additions & 0 deletions src/Providers/NvdCrudServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ public function boot()
__DIR__.'/../Config/config.php' => config_path('crud.php'),
__DIR__.'/../classic-templates' => base_path('resources/views/vendor/crud/classic-templates'),
__DIR__.'/../single-page-templates' => base_path('resources/views/vendor/crud/single-page-templates'),
__DIR__.'/../admin-lte-templates' => base_path('resources/views/vendor/crud/admin-lte-templates'),
__DIR__.'/../admin-lte-templates/dist' => public_path('dist'),
__DIR__.'/../admin-lte-templates/plugins' => public_path('plugins'),
],'nvd');
}

Expand Down
17 changes: 17 additions & 0 deletions src/admin-lte-templates/common/actions.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
/* @var $url */
/* @var $record */
?>
<td class="actions-cell">
<form class="form-inline" action="{{url('')}}/{{$url}}/{{$record->id}}" method="POST">
<a href="{{url('')}}/{{$url}}/{{$record->id}}"><i class="fa fa-eye"></i></a>&nbsp;&nbsp;

<a href="{{url('')}}/{{$url}}/{{$record->id}}/edit"><i class="fa fa-pencil-square-o"></i></a>

{{ csrf_field() }}
{{ method_field('DELETE') }}
<button style="outline: none;background: transparent;border: none;"
onclick="return confirm('Are You Sure?')"
type="submit" class="fa fa-trash text-danger"></button>
</form>
</td>
Loading