Commit a13dc6b1 by Pancholin

Initial commit

parents
File added
# Package products OneStartup
**onestartup/product** is a module product for websites
# Installation
- Run this in the terminal
```php
composer require onestartup/product
```
- after add the ServiceProvider to the providers array in config/app.php
```php
Onestartup\Product\ProductServiceProvider::class,
```
- Run migration
```php
php artisan migrate
```
- add next lines to app/User.php
```php
public function products()
{
return $this->hasMany('Onestartup\Product\Model\Product', 'user_id');
}
```
- run command for publish views
```php
php artisan vendor:publish --provider="Onestartup\ProductResource\ProductResourceServiceProvider"
```
- run serv
```php
php artisan serve
```
- test in this route how admin user
```php
http://localhost:8000/admin/product/product
```
- test in this route
```php
http://localhost:8000/portafolio
```
\ No newline at end of file
{
"name": "onestartup/product",
"description": "catalog of products for websites onestartup",
"type": "library",
"license": "Apache-2.0",
"authors": [
{
"name": "Angel MAS",
"email": "[email protected]"
}
],
"minimum-stability": "dev",
"require": {},
"autoload": {
"psr-4": {"Onestartup\\ProductResources\\": "src"}
}
}
File added
<?php
namespace Onestartup\ProductResource;
use Illuminate\Support\ServiceProvider;
class ProductResourceServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
include __DIR__.'/routes.php';
$this->loadMigrationsFrom(__DIR__.'/migrations');
if (is_dir(base_path() . '/resources/views/vendor/onestartup/product_resource')) {
$this->loadViewsFrom(base_path() . '/resources/views/vendor/onestartup/product_resource', 'product_resource-public');
$this->loadViewsFrom(__DIR__.'/views', 'product_resource');
} else {
$this->loadViewsFrom(__DIR__.'/views', 'product_resource');
$this->loadViewsFrom(__DIR__.'/views/public', 'product_resource-public');
}
$this->publishes([
__DIR__.'/views/public' => resource_path('views/vendor/onestartup/product_resource'),
]);
}
/**
* Register the application services.
*
* @return void
*/
public function register()
{
$this->app->make('Onestartup\ProductResource\Controller\AdminProductController');
$this->app->make('Onestartup\ProductResource\Controller\CategoryController');
$this->app->make('Onestartup\ProductResource\Controller\ProductController');
$this->app->make('Onestartup\ProductResource\Controller\ExtraFieldController');
}
}
<?php
namespace Onestartup\ProductResource\Controller;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Yajra\Datatables\Datatables;
use Onestartup\ProductResource\Model\ProductResourceCategory as Category;
use Onestartup\ProductResource\Model\ProductImageResource as Gallery;
use Onestartup\ProductResource\Model\ProductResourceResource as Resource;
use Onestartup\ProductResource\Model\ProductResource as Product;
use Onestartup\ProductResource\Model\ExtraFieldResource as Extra;
use Onestartup\ProductResource\Requests\RequestProduct;
class AdminProductController extends Controller
{
public function index()
{
return view('product_resource::product.index');
}
/**
* Show the form for creating a new resource.
* @return Response
*/
public function create()
{
$categories = Category::pluck('name', 'id');
$extras = Extra::where('active', true)->orderBy('variable', 'asc')->get();
return view('product_resource::product.create')
->with('categories', $categories)
->with('extras', $extras);
}
/**
* Store a newly created resource in storage.
* @param Request $request
* @return Response
*/
public function store(RequestProduct $request)
{
$product = new Product($request->all());
if (isset($request->cover)) {
$file = $request->file('cover');
$nombre = $file->getClientOriginalName();
$nombre_file = str_replace(' ', '_', $nombre);
$ubicacion_donde_guarda ='product_resources/cover/'.$nombre_file;
\Storage::disk('local')->put($ubicacion_donde_guarda, \File::get($file));
$product->cover = $ubicacion_donde_guarda;
}
\Auth::user()->products()->save($product);
return redirect()
->route('admin.product.edit', $product->id)
->with('message_success', "Producto guardado correctamente, continua agregando las imagenes correspondientes");
}
/**
* Show the form for editing the specified resource.
* @return Response
*/
public function edit($id)
{
$product = Product::find($id);
$categories = Category::pluck('name', 'id');
$extras = Extra::where('active', true)->orderBy('variable', 'asc')->get();
return view('product_resource::product.edit')
->with('categories', $categories)
->with('product', $product)
->with('extras', $extras);
}
/**
* Update the specified resource in storage.
* @param Request $request
* @return Response
*/
public function update(RequestProduct $request, $id)
{
$product = Product::find($id);
$product->fill($request->all());
if (isset($request->cover)) {
$file = $request->file('cover');
$nombre = $file->getClientOriginalName();
$nombre_file = str_replace(' ', '_', $nombre);
$ubicacion_donde_guarda ='product_resources/cover/'.$nombre_file;
\Storage::disk('local')->put($ubicacion_donde_guarda, \File::get($file));
$product->cover = $ubicacion_donde_guarda;
}
$product->save();
return redirect()
->back()
->with('message_info', 'Información actualizada correctamente');
}
/**
* Remove the specified resource from storage.
* @return Response
*/
public function destroy($id)
{
$product = Product::find($id);
$product->delete();
return redirect()
->back()
->with('message_danger', 'Producto eliminada correctamente');
}
public function getProducts()
{
$products = Product::select([
'id',
'name',
'slug',
'category_id',
'created_at',
'description',
'features',
'specifications'
]);
return Datatables::of($products)
->addColumn('main', function ($product) {
return
"<p class='mb0'>Nombre: <b>$product->name</b></p>".
"<p class='mb0'>Slug: <b>$product->slug</b></p>".
"<p class='mb0'>Categoria: <b>".$product->category->name."</b></p>".
"<p class='mb0'>Fecha creación: <b>".$product->created_at->format('d/m/Y')."</b></p>";
})
->addColumn('form', function ($product) {
return "<form method='POST' action='".route('admin.product_resources.products.destroy',$product->id)."'>".
"<input name='_method' type='hidden' value='DELETE' class='has-value'>".
csrf_field() .
"<button class='btn btn-danger btn-xs button-mb' onclick='return confirm();' type='submit'>".
"<i class='fas fa-trash-alt icon-special-size'></i>Eliminar</button>".
"</form>".
"<a href='".route('show.product', $product->slug)."' class='btn btn-xs info button-mb' target='new'>".
"<i class='fas fa-eye icon-special-size'></i>Ver</a>".
"<br><a href='".route('admin.product_resources.products.edit', $product->id)."' class='btn btn-xs accent mb0'>".
"<i class='fas fa-edit icon-special-size'></i>Editar</a>";
})
->rawColumns(['main', 'description', 'features', 'specifications', 'form'])
->make();
}
public function storeGallery(Request $request, $product_id)
{
$product = Product::find($product_id);
$asset = '/storage/product_resource/'.$product->id.'/gallery/';
$path = public_path().$asset;
$files = $request->file('file');
foreach($files as $file){
$fileName = $file->getClientOriginalName();
$nombre_file = str_replace(' ', '_', $fileName);
$file->move($path, $nombre_file);
$gallery = new Gallery([
'path'=>$asset.$nombre_file
]);
$product->images()->save($gallery);
}
return $product;
}
public function deleteImage($id)
{
$gallery = Gallery::find($id);
if (file_exists(public_path().$gallery->path)) {
unlink(public_path().$gallery->path);
}
$gallery->delete();
return redirect()
->back()
->with('message_danger', 'Imagen eliminada correctamente');
}
public function storeResource(Request $request, $product_id)
{
$product = Product::find($product_id);
$asset = '/storage/product_resource/'.$product->id.'/resource/';
$path = public_path().$asset;
$files = $request->file('file');
foreach($files as $file){
$fileName = $file->getClientOriginalName();
$nombre_file = str_replace(' ', '_', $fileName);
$type = $file->getMimeType();
$file->move($path, $nombre_file);
$resources = new Resource([
'path'=>$asset.$nombre_file,
'type'=>$type,
'name'=>$fileName
]);
$product->resources()->save($resources);
}
return $product;
}
public function deleteResource($id)
{
$resource = Resource::find($id);
if (file_exists(public_path().$resource->path)) {
unlink(public_path().$resource->path);
}
$resource->delete();
return redirect()
->back()
->with('message_danger', 'Recurso eliminado correctamente.');
}
public function deleteCover($id)
{
$product = Product::find($id);
if (file_exists(public_path().'/storage/'.$product->cover)) {
unlink(public_path().'/storage/'.$product->cover);
}
$product->cover = null;
$product->save();
//$gallery->delete();
return redirect()
->back()
->with('message_danger', 'Imagen eliminada correctamente');
}
}
<?php
namespace Onestartup\ProductResource\Controller;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Yajra\Datatables\Datatables;
use Onestartup\ProductResource\Model\ProductResourceCategory as Category;
use Onestartup\ProductResource\Requests\RequestCategory;
class CategoryController extends Controller
{
/**
* Display a listing of the resource.
* @return Response
*/
public function index()
{
$categories = Category::paginate(25);
return view('product_resource::category.index')
->with('categories', $categories);
}
/**
* Store a newly created resource in storage.
* @param Request $request
* @return Response
*/
public function store(RequestCreateCategory $request)
{
$category = new Category($request->all());
if (isset($request->portada)) {
$file = $request->file('portada');
$nombre = $file->getClientOriginalName();
$nombre_file = str_replace(' ', '_', $nombre);
$ubicacion_donde_guarda ='product_resources/categories/'.$nombre_file;
\Storage::disk('local')->put($ubicacion_donde_guarda, \File::get($file));
$category->cover = $ubicacion_donde_guarda;
}
$category->save();
return redirect()
->back()
->with('message_success', 'Categoria añadida correctamente');
}
/**
* Show the form for editing the specified resource.
* @return Response
*/
public function edit($id)
{
$category = Category::find($id);
return view('product_resource::category.edit')
->with('category', $category);
}
/**
* Update the specified resource in storage.
* @param Request $request
* @return Response
*/
public function update(RequestCategory $request, $id)
{
$category = Category::find($id);
$category->fill($request->all());
if (isset($request->portada) && $request->portada != null ) {
$file = $request->file('portada');
$nombre = $file->getClientOriginalName();
$nombre_file = str_replace(' ', '_', $nombre);
$ubicacion_donde_guarda ='product_resources/categories/'.$nombre_file;
\Storage::disk('local')->put($ubicacion_donde_guarda, \File::get($file));
$category->cover = $ubicacion_donde_guarda;
}
$category->save();
return redirect()
->back()
->with('message_success', 'Categoria actualizado correctamente');
}
/**
* Remove the specified resource from storage.
* @return Response
*/
public function destroy($id)
{
$category = Category::find($id);
$category->delete();
return redirect()
->back()
->with('message_danger', 'Categoria eliminada correctamente');
}
public function deleteCover($id)
{
$category = Category::find($id);
$category->cover = null;
$category->save();
return redirect()
->back()
->with('message_success', 'Imagen eliminada correctamente');
}
}
<?php
namespace Onestartup\ProductResource\Controller;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Yajra\Datatables\Datatables;
use Onestartup\ProductResource\Model\ExtraFieldResource as Extra;
use Onestartup\ProductResource\Requests\RequestExtraFields;
class ExtraFieldController extends Controller
{
/**
* Display a listing of the resource.
* @return Response
*/
public function index()
{
$extras = Extra::paginate(10);
$variables = [
'extra1'=>'Extra 1',
'extra2'=>'Extra 2',
'extra3'=>'Extra 3',
'extra4'=>'Extra 4',
'extra5'=>'Extra 5',
'extra6'=>'Extra 6',
'extra7'=>'Extra 7',
'extra8'=>'Extra 8',
'extra9'=>'Extra 9',
'extra10'=>'Extra 10'
];
return view('product_resource::extra.index')
->with('variables', $variables)
->with('extras', $extras);
}
/**
* Store a newly created resource in storage.
* @param Request $request
* @return Response
*/
public function store(RequestExtraFields $request)
{
//$values = implode(",", $request->values);
//return array_combine( explode(",", $values), explode(",", $values));
$extra = Extra::where('variable', $request->variable)->first();
if ($extra != null) {
return redirect()
->back()
->withInput()
->with('message_warning', "No se pudo agregar el registro: La variable $request->variable ya existe");
}
$extra = new Extra($request->all());
if ($request->type == 'select') {
if ($request->values != null) {
$extra->values = implode(",", $request->values);
} else {
return redirect()
->back()
->withInput()
->with('message_warning', 'No agregaste los valores para el select');
}
}
$extra->save();
return redirect()
->back()
->with('message_success', 'Categoria añadida correctamente');
}
/**
* Show the form for editing the specified resource.
* @return Response
*/
public function edit($id)
{
$extra = Extra::find($id);
$variables = [
'extra1'=>'Extra 1',
'extra2'=>'Extra 2',
'extra3'=>'Extra 3',
'extra4'=>'Extra 4',
'extra5'=>'Extra 5',
'extra6'=>'Extra 6',
'extra7'=>'Extra 7',
'extra8'=>'Extra 8',
'extra9'=>'Extra 9',
'extra10'=>'Extra 10'
];
return view('product_resource::extra.edit')
->with('extra', $extra)
->with('variables', $variables);
}
/**
* Update the specified resource in storage.
* @param Request $request
* @return Response
*/
public function update(RequestExtraFields $request, $id)
{
$extra = Extra::find($id);
$extra->fill($request->all());
if ($request->type == 'select') {
if ($request->values != null) {
$extra->values = implode(",", $request->values);
} else {
return redirect()
->back()
->withInput()
->with('message_warning', 'No agregaste los valores para el select');
}
}
$extra->save();
return redirect()
->back()
->with('message_success', 'Variable actualizado correctamente');
}
/**
* Remove the specified resource from storage.
* @return Response
*/
public function destroy($id)
{
$extra = Extra::find($id);
$extra->delete();
return redirect()
->back()
->with('message_danger', 'Variable eliminada correctamente');
}
}
<?php
namespace Onestartup\ProductResource\Controller;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Yajra\Datatables\Datatables;
use Onestartup\ProductResource\Model\ProductResource as Product;
use Onestartup\ProductResource\Model\ProductResourceCategory as Category;
class ProductController extends Controller
{
public function index(Request $request)
{
if(isset($request->category)){
$category = Category::where('slug', $request->category)->first();
$products = $category->products()->where('active', true)->paginate(15);
} else {
$products = Product::where('active', true)->paginate(25);
}
$otros = Product::where('active', true)->inRandomOrder()->take(3)->get();
$categories = Category::where('active', true)->get();
//$products;
return view('product_resource-public::list')
->with('categories', $categories)
->with('otros', $otros)
->with('products', $products);
}
public function show($slug)
{
$product = Product::where('slug',$slug)->first();
$otros = $product->category->products()->where('active', true)->take(3)->get();
$categories = Category::all();
if ($product != null) {
if (!$product->active) {
return redirect('inactivo');
}
} else {
return redirect('no_existe');
}
return view('product_resource-public::single')
->with('product', $product)
->with('categories', $categories)
->with('otros', $otros);
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateProductCategoriesResource extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('product_categories_resource', function (Blueprint $table) {
$table->increments('id');
$table->string('name', 355);
$table->string('description', 455)->nullable();
$table->string('cover', 455)->nullable();
$table->boolean('active')->default(true);
$table->string('slug')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('product_categories_resource');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateProductsResource extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('products_resource', function (Blueprint $table) {
$table->increments('id');
$table->string('name', 355);
$table->string('slug', 455);
$table->string('cover', 455)->nullable();
$table->text('description')->nullable();
$table->text('specifications')->nullable();
$table->text('features')->nullable();
$table->boolean('active')->default(true);
$table->date('publication_date')->nullable();
$table->string('extra1', 455)->nullable();
$table->string('extra2', 455)->nullable();
$table->string('extra3', 455)->nullable();
$table->string('extra4', 455)->nullable();
$table->string('extra5', 455)->nullable();
$table->string('extra6', 455)->nullable();
$table->string('extra7', 455)->nullable();
$table->string('extra8', 455)->nullable();
$table->string('extra9', 455)->nullable();
$table->string('extra10', 455)->nullable();
$table->integer('category_id')->unsigned();
$table->foreign('category_id')
->references('id')
->on('product_categories_resource')
->onDelete('cascade');
$table->integer('user_id')->unsigned();
$table->foreign('user_id')
->references('id')
->on('users')
->onDelete('cascade');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('products_resource');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateExtraFieldsResourceTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('extra_fields_resource', function (Blueprint $table) {
$table->increments('id');
$table->string('variable');
$table->string('alias');
$table->string('type');
$table->text('values')->nullable();
$table->boolean('active')->default(true);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('extra_fields_resource');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateProductImagesResourceTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('product_images_resource', function (Blueprint $table) {
$table->increments('id');
$table->string('path', 455);
$table->string('description', 455)->nullable();
$table->integer('product_id')->unsigned();
$table->foreign('product_id')
->references('id')
->on('products_resource')
->onDelete('cascade');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('product_images_resource');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateProductResourceResourcesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('product_resource_resources', function (Blueprint $table) {
$table->increments('id');
$table->string('name', 455);
$table->string('path', 455);
$table->string('description', 455)->nullable();
$table->string('type', 455);
$table->integer('product_id')->unsigned();
$table->foreign('product_id')
->references('id')
->on('products_resource')
->onDelete('cascade');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('product_resource_resources');
}
}
<?php
namespace Onestartup\ProductResource\Model;
use Illuminate\Database\Eloquent\Model;
class ExtraFieldResource extends Model
{
protected $table = 'extra_fields_resource';
protected $fillable = ['variable', 'alias', 'type', 'values', 'active'];
}
<?php
namespace Onestartup\ProductResource\Model;
use Illuminate\Database\Eloquent\Model;
class ProductImageResource extends Model
{
protected $table = 'product_images_resource';
protected $fillable = [
'path',
'description',
'product_id'
];
public function product()
{
return $this->belongsTo('Onestartup\ProductResource\Model\ProductResource', 'product_id');
}
}
<?php
namespace Onestartup\ProductResource\Model;
use Illuminate\Database\Eloquent\Model;
class ProductResource extends Model
{
protected $table = 'products_resource';
protected $fillable = [
'name',
'slug',
'description',
'specifications',
'features',
'active',
'publication_date',
'category_id',
'cover',
'extra1',
'extra2',
'extra3',
'extra4',
'extra5',
'extra6',
'extra7',
'extra8',
'extra9',
'extra10',
];
public function category()
{
return $this->belongsTo('Onestartup\ProductResource\Model\ProductResourceCategory', 'category_id');
}
public function user()
{
return $this->belongsTo('App\User', 'user_id');
}
public function images()
{
return $this->hasMany('Onestartup\ProductResource\Model\ProductImageResource', 'product_id');
}
public function resources()
{
return $this->hasMany('Onestartup\ProductResource\Model\ProductResourceResource', 'product_id');
}
}
<?php
namespace Onestartup\ProductResource\Model;
use Illuminate\Database\Eloquent\Model;
class ProductResourceCategory extends Model
{
protected $table = 'product_categories_resource';
protected $fillable = [
'name',
'description',
'cover',
'active',
'slug'
];
public function products()
{
return $this->hasMany('Onestartup\ProductResource\Model\ProductResource', 'category_id');
}
}
<?php
namespace Onestartup\ProductResource\Model;
use Illuminate\Database\Eloquent\Model;
class ProductResourceResource extends Model
{
protected $table = 'product_resource_resources';
protected $fillable = [
'name',
'path',
'description',
'type',
'product_id'
];
public function product()
{
return $this->belongsTo('Onestartup\ProductResource\Model\ProductResource', 'product_id');
}
}
<?php
namespace Onestartup\ProductResource\Requests;
use Illuminate\Foundation\Http\FormRequest;
class RequestCategory extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'name' => 'required|max:355',
'slug' => 'required|max:255',
'description'=> 'max:455',
'active' => 'required'
];
}
}
\ No newline at end of file
<?php
namespace Onestartup\ProductResource\Requests;
use Illuminate\Foundation\Http\FormRequest;
class RequestExtraFields extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'variable' => 'required|max:255',
'alias' => 'required|max:255',
'type' => 'required|max:255',
'active' => 'required|boolean'
];
}
}
\ No newline at end of file
<?php
namespace Onestartup\ProductResource\Requests;
use Illuminate\Foundation\Http\FormRequest;
class RequestProduct extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'name' => 'required|max:355',
'slug' => 'required|max:455',
'description'=> 'required',
'specifications' => 'required',
'features' => 'required',
'active' => 'required|boolean',
'publication_date' => 'required',
'extra1' => 'max:455',
'extra2' => 'max:455',
'extra3' => 'max:455',
'extra4' => 'max:455',
'extra5' => 'max:455',
'extra6' => 'max:455',
'extra7' => 'max:455',
'extra8' => 'max:455',
'extra9' => 'max:455',
'extra10' => 'max:455',
'category_id' => 'required|numeric'
];
}
}
\ No newline at end of file
<?php
Route::group(['middleware' => ['web', 'auth', 'is_admin']], function(){
Route::resource('admin/product_resources/products', 'Onestartup\ProductResource\Controller\AdminProductController', ['as'=>'admin.product_resources']);
Route::delete('delete/cover/product_resources/{id}', 'Onestartup\ProductResource\Controller\AdminProductController@deleteCover')
->name('delete.cover.product_resources');
Route::resource('admin/product_resources/category', 'Onestartup\ProductResource\Controller\CategoryController', ['as'=>'admin.product_resources']);
Route::delete('delete/cover/category/product/{id}', 'Onestartup\ProductResource\Controller\CategoryController@deleteCover')
->name('delete.cover.category.product_resources');
Route::get('admin/product_resources/datatable', 'Onestartup\ProductResource\Controller\AdminProductController@getProducts')
->name('datatable.product_resources');
Route::post('admin/product_resources/{id}/gallery', 'Onestartup\ProductResource\Controller\AdminProductController@storeGallery')
->name('admin.product_resources.files.store');
Route::delete('admin/product_resources/delete/gallery/{id}', 'Onestartup\ProductResource\Controller\AdminProductController@deleteImage')
->name('admin.product_resources.gallery.delete');
Route::resource('admin/product_resources/extra-fields', 'Onestartup\ProductResource\Controller\ExtraFieldController', ['as'=>'admin.product_resources']);
Route::post('admin/product_resources/{id}/resources', 'Onestartup\ProductResource\Controller\AdminProductController@storeResource')
->name('admin.product_resources.resources.store');
Route::delete('admin/product_resources/delete/resource/{id}', 'Onestartup\ProductResource\Controller\AdminProductController@deleteResource')
->name('admin.product_resources.resources.delete');
});
Route::group(['middleware' => ['web']], function(){
Route::get(env('SLUG_PRODUCTSRESOURCE').'/{slug}', 'Onestartup\ProductResource\Controller\ProductController@show')->name('show.product_resource');
Route::get(env('SLUG_PRODUCTSRESOURCE'), 'Onestartup\ProductResource\Controller\ProductController@index')->name('main.product_resource');
});
@extends('crm-admin::main-layout')
@section('breadcrumb')
<li class="breadcrumb-item">
<a href="{{route('home')}}">Home</a>
</li>
<li class="breadcrumb-item">
<a href="{{route('admin.product_resources.products.index')}}">Productos con recursos</a>
</li>
<li class="breadcrumb-item">
<a href="{{route('admin.product_resources.category.index')}}">Lista de categorías</a>
</li>
<li class="breadcrumb-item active">
{{$category->name}}
</li>
@endsection
@section('content')
<div class='row'>
<div class='col-md-12'>
<div class='box'>
<div class='box-header dark'>
<h2>Actualizar información</h2>
</div>
<div class='box-body'>
<div class='col-md-12'>
{!! Form::model($category,['route'=> ['admin.product_resources.category.update',$category->id],"method"=>"PUT", 'enctype'=>'multipart/form-data']) !!}
@include('product_resource::category.fields')
</div>
</div>
<div class='dker p-a text-right'>
<div class='col-md-12'>
<a class='btn danger' href="{{route('admin.product.category.index')}}">Cancelar</a>
{!! Form::submit('Actualizar información', ['class'=>'btn dark']) !!}
{!! Form::close() !!}
</div>
</div>
</div>
</div>
</div>
<!-- .modal nuevo contrato -->
<div class='modal fade' data-backdrop='true' id='ver'>
<div class='modal-dialog modal-lg'>
<div class='modal-content box-shadow-z3'>
<div class='modal-body text-center p-lg'>
@if ($category->cover == null)
<h4> No hay imagen asignada</h4>
@else
<img class='image-modal-preview' src="{{asset('storage/'.$category->cover)}}">
@endif
</div>
<div class='modal-footer'>
<button class='btn dark p-x-md' data-dismiss='modal' type='button'>Cerrar</button>
@if($category->cover != null)
{!! Form::open(['route'=> ['delete.cover.category.product_resources',$category->id],'method'=>'DELETE'])!!}
<button class='btn btn-danger button-mb' onclick="return confirm('¿Estás seguro de eliminar este elemento?');" type='submit'>
<i class='fas fa-trash-alt icon-special-size'>
Eliminar
</i>
</button>
{!! Form::close()!!}
@endif
</div>
</div>
<!-- /.modal-content -->
</div>
</div>
@endsection
<div class="form-group">
{!! Form::label('name', 'Nombre *') !!}
{!! Form::text('name', null, ["class"=>"form-control", "required"=>"required", "placeholder"=>"Coloque aquí el nombre de la categoría", "id"=>"first"]) !!}
</div>
<div class="form-group">
{!! Form::label('slug', 'URL Slug *') !!}
{!! Form::text('slug', null, ["class"=>"form-control", "required"=>"required", "placeholder"=>"Coloque aquí la liga o URL de la categoría", "id"=>"second"]) !!}
</div>
<div class="form-group">
{!! Form::label('description', 'Resumen') !!}
{!! Form::text('description', null, ["class"=>"form-control", "placeholder"=>"Coloque la información descriptiva de la categoría"]) !!}
</div>
<div class="form-group">
{!! Form::label('active', 'Estado') !!}
{!! Form::select('active', [true=>'Activo', false=>'Inactivo'], null, ["class"=>"form-control", "required"=>"required"]) !!}
</div>
<div class="form-group">
{!! Form::label('portada', 'Imagén de portada') !!}
@if (isset($category))
<span>
<a class="btn btn-xs accent" data-target="#ver" data-toggle="modal" href="#" ui-toggle-class="fade-up-big">
Ver actual
<i class="fa fa-eye"></i>
</a>
</span>
@endif
<br>
{!! Form::file('portada', null, ["class"=>"form-control"]) !!}
</div>
\ No newline at end of file
@extends('crm-admin::main-layout')
@section('breadcrumb')
<li class="breadcrumb-item">
<a href="{{route('home')}}">Home</a>
</li>
<li class="breadcrumb-item">
<a href="{{route('admin.product_resources.products.index')}}">Productos con recursos</a>
</li>
<li class="breadcrumb-item active">
Lista de categorías
</li>
@endsection
@section('content')
<div class='row'>
<div class='col-md-12 collapse' id='agregarCategoria'>
<div class='box'>
<div class='box-header dark'>
<h2>
Agregar nueva categoria
<span></span>
<a aria-expanded='false' class='btn btn-xs btn-danger button-ml' data-toggle='collapse' href='#agregarCategoria'>
Cancelar
</a>
</h2>
</div>
<div class='box-body'>
<div class='col-md-12'>
{!! Form::open(['route'=> 'admin.product_resources.category.store','method'=>'POST', 'enctype'=>'multipart/form-data']) !!}
@include('product_resource::category.fields')
<div class='form-group'>
<button class='btn btn-primary' type='submit'>
Registrar
</button>
</div>
{!! Form::close() !!}
</div>
</div>
</div>
</div>
<div class='col-md-12'>
<div class='box'>
<div class='box-header dark'>
<h2>
Listado de Categorias de productos
<span>
<a aria-expanded='false' class='btn btn-xs btn-info button-ml' data-toggle='collapse' href='#agregarCategoria'>
<i class='fas fa-plus'></i>
Agregar Categorías
</a>
</span>
</h2>
</div>
<div class='box-body'>
<div class='col-md-12'>
<table class='table'>
<tr>
<th>#</th>
<th>Categoría</th>
<th>Descripción</th>
<th>Productos</th>
<th></th>
</tr>
@foreach ($categories as $category)
<tr>
<td> {{$category->id}}</td>
<td>
<p> {{$category->name}}</p>
<p>
URL Slug:
<b> {{$category->slug}}</b>
</p>
</td>
<td> {{$category->description}}</td>
<td> {{$category->products()->count()}}</td>
<td>
{!! Form::open(['route'=> ['admin.product_resources.products.destroy',$category->id],'method'=>'DELETE'])!!}
<button class='btn btn-danger btn-xs button-mb' onclick="return confirm('¿Estás seguro de eliminar este elemento?');" type='submit'>
<i class='fas fa-trash-alt icon-special-size'></i>
Eliminar
</button>
{!! Form::close()!!}
<a class='btn btn-xs accent' href="{{route('admin.product_resources.category.edit', $category->id)}}">
<i class='fas fa-edit icon-special-size'></i>
Editar
</a>
</td>
@endforeach
</tr>
</table>
</div>
</div>
<div class='dker p-a text-right'>
{{ $categories->links() }}
</div>
</div>
</div>
</div>
@endsection
@extends('crm-admin::main-layout')
@section('breadcrumb')
<li class="breadcrumb-item">
<a href="{{route('home')}}">Home</a>
</li>
<li class="breadcrumb-item">
<a href="{{route('admin.product_resources.products.index')}}">Productos con recursos</a>
</li>
<li class="breadcrumb-item">
<a href="{{route('admin.product_resources.extra-fields.index')}}">Lista de campos extras</a>
</li>
<li class="breadcrumb-item active">
Actualizar campos extra
</li>
@endsection
@section('content')
<div class='row'>
<div class='col-md-12'>
<div class='box'>
<div class='box-header dark'>
<h2>Actualizar información</h2>
</div>
<div class='box-body'>
<div class='col-md-12'>
{!! Form::model($extra,['route'=> ['admin.product_resources.extra-fields.update',$extra->id],"method"=>"PUT", 'enctype'=>'multipart/form-data']) !!}
@include('product_resource::extra.fields')
</div>
</div>
<div class='dker p-a text-right'>
<div class='col-md-12'>
<a class='btn danger' href="{{route('admin.shop.extra-fields.index')}}">Cancelar</a>
{!! Form::submit('Actualizar información', ['class'=>'btn dark']) !!}
{!! Form::close() !!}
</div>
</div>
</div>
</div>
</div>
@endsection
<div class="form-group">
{!! Form::label('variable', 'Variable') !!}
{!! Form::select('variable', $variables, null, ["class"=>"form-control", "required"=>"required", "placeholder"=>"Elija una variable"]) !!}
</div>
<div class="form-group">
{!! Form::label('alias', 'Etiqueta de la variable') !!}
{!! Form::text('alias', null, ["class"=>"form-control", "required"=>"required", "placeholder"=>"Ej. Tipo de producto"]) !!}
</div>
<div class="form-group">
{!! Form::label('type', 'Tipo de input') !!}
{!! Form::select('type', ['text'=>'Texto', 'select'=>'Select', 'textarea'=>'TextArea'], null, ["class"=>"form-control", "required"=>"required", "placeholder"=>"Elija un tipo", "id"=>"type"]) !!}
</div>
<div class="form-group" id="select-values" style="display: none;">
{!! Form::label('values', 'Valores del select: ', ['class'=>'control-label'])!!}
{{ isset($extra->values) ? $extra->values : null }}
{!! Form::select('values[]', [], isset($extra->values) ? explode(",",$extra->values) : null, ["id"=>"values", "multiple"=>"multiple", "style"=>"width:100%;"]) !!}
</div>
<div class="form-group">
{!! Form::label('active', 'Estado') !!}
{!! Form::select('active', [true=>'Activo', false=>'Inactivo'], null, ["class"=>"form-control", "required"=>"required"]) !!}
</div>
@section('script_extras')
<script>
$(function() {
$('#values').select2({
tags: true
});
$('#type').on('change', function() {
if (this.value == 'select') {
$("#select-values").show();
} else {
$("#values option:selected").each(function(){
$(this).remove();
});
$("#select-values").hide();
}
})
if($("#type").val() == "select"){
$("#select-values").show();
} else {
$("#select-values").hide();
}
});
</script>
@endsection
\ No newline at end of file
@extends('crm-admin::main-layout')
@section('breadcrumb')
<li class="breadcrumb-item">
<a href="{{route('home')}}">Home</a>
</li>
<li class="breadcrumb-item">
<a href="{{route('admin.product_resources.products.index')}}">Productos con recursos</a>
</li>
<li class="breadcrumb-item active">
Lista de campos extras
</li>
@endsection
@section('content')
<div class='row'>
<div class='col-md-12 collapse' id='agregarCategoria'>
<div class='box'>
<div class='box-header dark'>
<h2>
Agregar campos extras
<span></span>
<a aria-expanded='false' class='btn btn-xs btn-danger button-ml' data-toggle='collapse' href='#agregarCategoria'>
Cancelar
</a>
</h2>
</div>
<div class='box-body'>
<div class='col-md-12'>
{!! Form::open(['route'=> 'admin.product_resources.extra-fields.store','method'=>'POST', 'enctype'=>'multipart/form-data']) !!}
@include('product_resource::extra.fields')
<div class='form-group'>
<button class='btn btn-primary' type='submit'>
Registrar
</button>
</div>
{!! Form::close() !!}
</div>
</div>
</div>
</div>
<div class='col-md-12'>
<div class='box'>
<div class='box-header dark'>
<h2>
Listado de campos extras
<span>
<a aria-expanded='false' class='btn btn-xs btn-info button-ml' data-toggle='collapse' href='#agregarCategoria'>
<i class='fas fa-plus'></i>
Agregar campos extras
</a>
</span>
</h2>
</div>
<div class='box-body'>
<div class='col-md-12'>
<table class='table'>
<tr>
<th>#</th>
<th>Informacion</th>
<th>Valores</th>
<th></th>
</tr>
@foreach ($extras as $extra)
<tr>
<td> {{$extra->id}}</td>
<td>
Variable: <b>{{$extra->variable}}</b><br>
Etiqueta: <b>{{$extra->alias}}</b><br>
Tipo: <b>{{$extra->type}}</b><br>
Estatus: <b>{{$extra->active ? "Activo" : "Inactivo"}}</b>
</td>
<td> Opciones: <br><b>{{$extra->values != null ? $extra->values : "No aplica"}}</b></td>
<td>
{!! Form::open(['route'=> ['admin.product_resources.extra-fields.destroy',$extra->id],'method'=>'DELETE'])!!}
<button class='btn btn-danger btn-xs button-mb' onclick="return confirm('¿Estás seguro de eliminar este elemento?');" type='submit'>
<i class='fas fa-trash-alt icon-special-size'></i>
Eliminar
</button>
{!! Form::close()!!}
<a class='btn btn-xs accent' href="{{route('admin.product_resources.extra-fields.edit', $extra->id)}}">
<i class='fas fa-edit icon-special-size'></i>
Editar
</a>
</td>
@endforeach
</tr>
</table>
</div>
</div>
<div class='dker p-a text-right'>
{{ $extras->links() }}
</div>
</div>
</div>
</div>
@endsection
@extends('crm-admin::main-layout')
@section('breadcrumb')
<li class="breadcrumb-item">
<a href="{{route('home')}}">Home</a>
</li>
<li class="breadcrumb-item">
<a href="{{route('admin.product_resources.products.index')}}">Productos con recursos</a>
</li>
<li class="breadcrumb-item">
<a href="{{route('admin.product_resources.products.index')}}">Lista de productos</a>
</li>
<li class="breadcrumb-item active">
Nuevo producto
</li>
@endsection
@section('content')
<div class='row'>
<div class='col-md-12'>
<div class='box'>
<div class='box-header dark'>
<h2>Agregar nuevo producto</h2>
</div>
<div class='box-body'>
{!! Form::open(['route'=> 'admin.product_resources.products.store','method'=>'POST', "id"=>"target", 'enctype'=>'multipart/form-data']) !!}
@include('product_resource::product.fields')
</div>
<div class='dker p-a text-right'>
<div class='col-md-12'>
<a class='btn danger' href="{{route('admin.shop.product.index')}}" style='margin-right:10px'>Cancelar</a>
<button class='btn dark' type='submit'>
Registrar
</button>
{!! Form::close() !!}
</div>
</div>
</div>
</div>
</div>
@endsection
@section('script_extras')
<script src='https://cdn.ckeditor.com/4.8.0/standard/ckeditor.js'></script>
<script>
var options = {
filebrowserImageBrowseUrl: '/laravel-filemanager?type=Images',
filebrowserImageUploadUrl: '/laravel-filemanager/upload?type=Images&_token=',
filebrowserBrowseUrl: '/laravel-filemanager?type=Files',
filebrowserUploadUrl: '/laravel-filemanager/upload?type=Files&_token='
};
</script>
<script>
CKEDITOR.replace('description', options);
CKEDITOR.replace('features', options);
CKEDITOR.replace('specifications', options);
$("#publication_date").datepicker({
dateFormat: "yy-mm-dd"
});
</script>
@if($extras->count() > 0)
@foreach($extras as $extra)
@if($extra->type == 'textarea')
<script type="text/javascript">
CKEDITOR.replace({{$extra->variable}}, options);
</script>
@endif
@endforeach
@endif
@endsection
<div class="row">
<div class="col-md-6">
<div class="form-group">
{!! Form::label('name', 'Nombre', ['class'=>'control-label'])!!}
{!! Form::text('name', null, ["class"=>"form-control", "required"=>"required", "id"=>"first"]) !!}
</div>
</div>
<div class="col-md-6">
<div class="form-group">
{!! Form::label('slug', 'URL Slug', ['class'=>'control-label'])!!}
{!! Form::text('slug', null, ["class"=>"form-control", "required"=>"required", "id"=>"second"]) !!}
</div>
</div>
</div>
<div class='row'>
<div class='col-md-6'>
<div class="form-group" >
{!! Form::label('active', 'Estado', ['class'=>'control-label'])!!}
{!! Form::select('active', [true=>'Activo', false=>'Inactivo'], null, ["class"=>"form-control", "required"=>"required"]) !!}
</div>
</div>
<div class='col-md-6'>
<div class="form-group" >
{!! Form::label('category_id', 'Categoria', ['class'=>'control-label'])!!}
{!! Form::select('category_id', $categories, null, ["class"=>"form-control", "required"=>"required"]) !!}
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
{!! Form::label('cover', 'Portada', ['class'=>'control-label'])!!}
@if (isset($product))
<span>
<a class="btn btn-xs accent" data-target="#ver" data-toggle="modal" href="#" ui-toggle-class="fade-up-big">
Ver actual
<i class="fa fa-eye"></i>
</a>
</span>
@endif
<br>
{!! Form::file('cover', null, ["class"=>"form-control", "required"=>"required"]) !!}
</div>
</div>
<div class="col-md-6">
<div class="form-group">
{!! Form::label('publication_date', 'Fecha de publicación', ['class'=>'control-label'])!!}
{!! Form::text('publication_date', isset($product) ? null: date('Y-m-d'), ["class"=>"form-control", "required"=>"required", "id"=>"publication_date"]) !!}
</div>
</div>
</div>
<div class="row">
@if($extras->count() > 0)
@foreach($extras as $extra)
@if($extra->type == 'select')
<div class="col-md-4">
<div class="form-group">
{!! Form::label($extra->variable, $extra->alias, ['class'=>'control-label'])!!}
{!! Form::select($extra->variable, array_combine( explode(",", $extra->values), explode(",", $extra->values)), null, ["class"=>"form-control", "placeholder"=>"Elije una opción"]) !!}
</div>
</div>
@endif
@if($extra->type == 'text')
<div class="col-md-4">
<div class="form-group">
{!! Form::label($extra->variable, $extra->alias, ['class'=>'control-label'])!!}
{!! Form::text($extra->variable, null, ["class"=>"form-control"]) !!}
</div>
</div>
@endif
@if($extra->type == 'textarea')
<div class="col-md-4">
<div class="form-group">
{!! Form::label($extra->variable, $extra->alias, ['class'=>'control-label'])!!}
{!! Form::textarea($extra->variable, null, ["class"=>"form-control"]) !!}
</div>
</div>
@endif
@endforeach
@endif
</div>
<div class="row">
<div class="col-md-6">
{!! Form::label('description', 'Descripción', ['class'=>'control-label'])!!}
{!! Form::textarea('description', null, ["class"=>"form-control", "required"=>"required", 'id'=>'body', 'rows'=>"30", 'cols'=>"80"]) !!}
</div>
<div class="col-md-6">
{!! Form::label('features', 'Características', ['class'=>'control-label'])!!}
{!! Form::textarea('features', null, ["class"=>"form-control", "required"=>"required", 'id'=>'body', 'rows'=>"30", 'cols'=>"80"]) !!}
</div>
</div>
<div class="row">
<div class="col-md-6">
{!! Form::label('specifications', 'Especificaciones', ['class'=>'control-label'])!!}
{!! Form::textarea('specifications', null, ["class"=>"form-control", "required"=>"required", 'id'=>'body', 'rows'=>"30", 'cols'=>"80"]) !!}
</div>
</div>
@extends('crm-admin::main-layout')
@section('breadcrumb')
<li class="breadcrumb-item">
<a href="{{route('home')}}">Home</a>
</li>
<li class="breadcrumb-item">
<a href="{{route('admin.product_resources.products.index')}}">Productos con recursos</a>
</li>
<li class="breadcrumb-item active">
Lista de productos
</li>
@endsection
@section('content')
<div class='row'>
<div class='col-md-12'>
<div class='box'>
<div class='box-header dark'>
<h2>
Listado de productos
<span>
<a class='btn btn-xs btn-info button-ml' href="{{route('admin.product_resources.products.create')}}">
<i class='fas fa-plus'></i>
Agregar producto
</a>
</span>
</h2>
</div>
<div class='box-body'>
<table class='table' id='products'>
<thead>
<tr>
<th>#</th>
<th>Producto</th>
<th>Descripcion</th>
<th>Caracteristicas</th>
<th>Especificaciones</th>
<th></th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script>
$(function() {
$('#products').DataTable({
processing: true,
serverSide: true,
pageLength: 25,
ajax: '{{ route("datatable.product_resources") }}',
columns: [
{data: 'id', name: 'id'},
{data: 'main', name: 'main'},
{data: 'description', name: 'description'},
{data: 'features', name: 'features'},
{data: 'specifications', name: 'specifications'},
{data: 'form', name: 'form'},
]
});
});
</script>
@endpush
<!DOCTYPE html>
<html>
<head>
<title>
{{$product->name or "PCatalogo de proeudtos"}}
</title>
@include('product_resource-public::metatags')
</head>
<body>
{{-- Aqui toda la estructura del blog--}}
@yield('content')
{{-- Aqui el footer --}}
<!-- Importante: scripts elementales no remover -->
<script src='https://unpkg.com/sweetalert/dist/sweetalert.min.js'></script>
<!-- ******************************************* -->
@yield('scripts_extra')
</body>
</html>
\ No newline at end of file
@extends('product_resource-public::layout')
@section('content')
Listado de entradas
<p>
Categorias:
{{$categories}}
</p>
<p>
Productos todos
@foreach($products as $product)
{{$product}}
@endforeach
</p>
<p>
Productos al azar
{{$otros}}
</p>
<p>
Paginacion:
{!! $products->links() !!}
</p>
@endsection
\ No newline at end of file
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
<meta charset='utf-8'>
<meta content='ie=edge' http-equiv='x-ua-compatible'>
<meta content='' name='description'>
<meta content='width=device-width, initial-scale=1' name='viewport'>
<meta content="{{isset($product) ? strip_tags(substr($product->description, 0, 120), '') :'Descripcion general del product'}}" name='description'>
<link href="{{isset($product) ? route('show.product', $product->slug) : route('main.product')}}" rel='canonical'>
<meta content='es_MX' property='og:locale'>
<meta content='website' property='og:type'>
<meta content="{{$product->name or 'Titulo general del blog'}}" property='og:title'>
<meta content="{{isset($product) ? strip_tags(substr($product->description, 0, 120), '') :'Descripcion general del product'}}" property='og:description'>
<meta content="{{isset($product) ? route('show.product', $product->slug) : route('main.product')}}" property='og:url'>
<meta content='{{env('APP_NAME')}}' property='og:site_name'>
<meta content="{{asset('assets/img/Odessa-Seguros-alta-2.png')}}" property='og:image'>
<meta content="{{asset('assets/img/Odessa-Seguros-alta-2.png')}}" property='og:image:secure_url'>
<meta content='summary' name='twitter:card'>
<meta content="{{isset($product) ? strip_tags(substr($product->description, 0, 120), '') :'Descripcion general del product'}}" name='twitter:description'>
<meta content="{{$product->name or 'titulo general del product'}}" name='twitter:title'>
<meta content='@odessa_seguros' name='twitter:site'>
<meta content="{{asset('assets/img/Odessa-Seguros-alta-2.png')}}" name='twitter:image'>
<meta content='@odessa_seguros' name='twitter:creator'>
@extends('product_resource-public::layout')
@section('content')
<p>
Producto: {{$product}}
</p>
<p>
Categoria: {{$product->category}}
</p>
<p>
Recursos: {{$product->resources}}
</p>
<p>
Categorias: Listado de categorias:
</p>
<p>{{$categories}}</p>
<p>
Listado de productos relacionados con sus categorias:
</p>
<p>
{{$otros}}
</p>
{{-- Caja de compartir con redes sociales--}}
<div class="addthis_inline_share_toolbox_le2j"></div>
{{-- *********************************** --}}
@endsection
<?php
// autoload.php @generated by Composer
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit7173633b0cb420d97a2e8a09a0590ba0::getLoader();
Copyright (c) Nils Adermann, Jordi Boggiano
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
<?php
// autoload_classmap.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
);
<?php
// autoload_namespaces.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
);
<?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'Onestartup\\Product\\' => array($baseDir . '/src'),
);
<?php
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit7173633b0cb420d97a2e8a09a0590ba0
{
private static $loader;
public static function loadClassLoader($class)
{
if ('Composer\Autoload\ClassLoader' === $class) {
require __DIR__ . '/ClassLoader.php';
}
}
public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit7173633b0cb420d97a2e8a09a0590ba0', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit7173633b0cb420d97a2e8a09a0590ba0', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit7173633b0cb420d97a2e8a09a0590ba0::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->set($namespace, $path);
}
$map = require __DIR__ . '/autoload_psr4.php';
foreach ($map as $namespace => $path) {
$loader->setPsr4($namespace, $path);
}
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
}
$loader->register(true);
return $loader;
}
}
<?php
// autoload_static.php @generated by Composer
namespace Composer\Autoload;
class ComposerStaticInit7173633b0cb420d97a2e8a09a0590ba0
{
public static $prefixLengthsPsr4 = array (
'O' =>
array (
'Onestartup\\Product\\' => 19,
),
);
public static $prefixDirsPsr4 = array (
'Onestartup\\Product\\' =>
array (
0 => __DIR__ . '/../..' . '/src',
),
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit7173633b0cb420d97a2e8a09a0590ba0::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit7173633b0cb420d97a2e8a09a0590ba0::$prefixDirsPsr4;
}, null, ClassLoader::class);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment