Comparar commits

...

5 Commits

Se han modificado 18 ficheros con 814 adiciones y 590 borrados

Ver fichero

@@ -1,23 +0,0 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class BuscadorController extends Controller
{
public function mostrarBuscador(Request $request){
return view('buscador');
}
public function procesarFormulario(Request $request){
$request->validate([
'contenido' => 'required|min:3'
]);
return "Cero resultados para: ". $request->input('contenido');
}
}

Ver fichero

@@ -1,22 +0,0 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class SaludoController extends Controller
{
/**
* Handle the incoming request.
*/
public function __invoke(Request $request, $nombre)
{
return view('saludo', ['nombrePersona'=> $nombre]);
$request->validate([
'nombre' => 'required|size:2'
]);
return view('saludo', ['nombrePersona' => $nombre]);
}
}

Ver fichero

@@ -1,27 +0,0 @@
<?php
namespace App\Livewire;
use App\Models\Album;
use Livewire\Component;
class Buscador extends Component
{
public $nombre;
public $resultados = [];
public function buscar(){
$this->validate([
'nombre' => 'required'
]);
$this->resultados = Album::where('Title', 'like', "$this->nombre%")->with('artista')->get();
}
public function render()
{
return view('livewire.buscador');
}
}

Ver fichero

@@ -1,27 +0,0 @@
<?php
namespace App\Livewire;
use Livewire\Component;
class Contador extends Component
{
public $cantidad = 0;
public function incrementar()
{
$this->cantidad++;
}
public function decrementar()
{
$this->cantidad--;
}
public function render()
{
return view('livewire.contador');
}
}

Ver fichero

@@ -4,6 +4,7 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Album extends Model class Album extends Model
{ {
@@ -13,8 +14,13 @@ class Album extends Model
return $this->belongsTo(Artista::class, 'ArtistId'); return $this->belongsTo(Artista::class, 'ArtistId');
} }
public function tracks(): HasMany
{
return $this->hasMany(Track::class, 'AlbumId');
}
protected $fillable = ['AlbumId', 'Title'];
protected $fillable = ['AlbumId', 'Title', 'ArtistId'];
protected $table = 'albums'; //Si la tabla no es la esperada, definimos la variable $table con el nombre correspondiente. protected $table = 'albums'; //Si la tabla no es la esperada, definimos la variable $table con el nombre correspondiente.

Ver fichero

@@ -7,6 +7,7 @@
"license": "MIT", "license": "MIT",
"require": { "require": {
"php": "^8.2", "php": "^8.2",
"doctrine/dbal": "^4.3",
"filament/actions": "^4.0", "filament/actions": "^4.0",
"filament/forms": "^4.0", "filament/forms": "^4.0",
"filament/infolists": "^4.0", "filament/infolists": "^4.0",
@@ -27,7 +28,8 @@
"mockery/mockery": "^1.6", "mockery/mockery": "^1.6",
"nunomaduro/collision": "^8.6", "nunomaduro/collision": "^8.6",
"pestphp/pest": "^4.1", "pestphp/pest": "^4.1",
"pestphp/pest-plugin-laravel": "^4.0" "pestphp/pest-plugin-laravel": "^4.0",
"reliese/laravel": "^1.4"
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {

316
composer.lock generado
Ver fichero

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "9ae6e304096f1ae29fec59a779cd6126", "content-hash": "40dce9cf7a3165eeb8d5a5629c6dcaf8",
"packages": [ "packages": [
{ {
"name": "anourvalar/eloquent-serialize", "name": "anourvalar/eloquent-serialize",
@@ -531,6 +531,160 @@
}, },
"time": "2024-07-08T12:26:09+00:00" "time": "2024-07-08T12:26:09+00:00"
}, },
{
"name": "doctrine/dbal",
"version": "4.3.4",
"source": {
"type": "git",
"url": "https://github.com/doctrine/dbal.git",
"reference": "1a2fbd0e93b8dec7c3d1ac2b6396a7b929b130dc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/dbal/zipball/1a2fbd0e93b8dec7c3d1ac2b6396a7b929b130dc",
"reference": "1a2fbd0e93b8dec7c3d1ac2b6396a7b929b130dc",
"shasum": ""
},
"require": {
"doctrine/deprecations": "^1.1.5",
"php": "^8.2",
"psr/cache": "^1|^2|^3",
"psr/log": "^1|^2|^3"
},
"require-dev": {
"doctrine/coding-standard": "14.0.0",
"fig/log-test": "^1",
"jetbrains/phpstorm-stubs": "2023.2",
"phpstan/phpstan": "2.1.30",
"phpstan/phpstan-phpunit": "2.0.7",
"phpstan/phpstan-strict-rules": "^2",
"phpunit/phpunit": "11.5.23",
"slevomat/coding-standard": "8.24.0",
"squizlabs/php_codesniffer": "4.0.0",
"symfony/cache": "^6.3.8|^7.0",
"symfony/console": "^5.4|^6.3|^7.0"
},
"suggest": {
"symfony/console": "For helpful console commands such as SQL execution and import of files."
},
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\DBAL\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
}
],
"description": "Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.",
"homepage": "https://www.doctrine-project.org/projects/dbal.html",
"keywords": [
"abstraction",
"database",
"db2",
"dbal",
"mariadb",
"mssql",
"mysql",
"oci8",
"oracle",
"pdo",
"pgsql",
"postgresql",
"queryobject",
"sasql",
"sql",
"sqlite",
"sqlserver",
"sqlsrv"
],
"support": {
"issues": "https://github.com/doctrine/dbal/issues",
"source": "https://github.com/doctrine/dbal/tree/4.3.4"
},
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdbal",
"type": "tidelift"
}
],
"time": "2025-10-09T09:11:36+00:00"
},
{
"name": "doctrine/deprecations",
"version": "1.1.5",
"source": {
"type": "git",
"url": "https://github.com/doctrine/deprecations.git",
"reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/deprecations/zipball/459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38",
"reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"conflict": {
"phpunit/phpunit": "<=7.5 || >=13"
},
"require-dev": {
"doctrine/coding-standard": "^9 || ^12 || ^13",
"phpstan/phpstan": "1.4.10 || 2.1.11",
"phpstan/phpstan-phpunit": "^1.0 || ^2",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.6 || ^10.5 || ^11.5 || ^12",
"psr/log": "^1 || ^2 || ^3"
},
"suggest": {
"psr/log": "Allows logging deprecations via PSR-3 logger implementation"
},
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\Deprecations\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.",
"homepage": "https://www.doctrine-project.org/",
"support": {
"issues": "https://github.com/doctrine/deprecations/issues",
"source": "https://github.com/doctrine/deprecations/tree/1.1.5"
},
"time": "2025-04-07T20:06:18+00:00"
},
{ {
"name": "doctrine/inflector", "name": "doctrine/inflector",
"version": "2.1.0", "version": "2.1.0",
@@ -3908,6 +4062,55 @@
], ],
"time": "2025-08-21T11:53:16+00:00" "time": "2025-08-21T11:53:16+00:00"
}, },
{
"name": "psr/cache",
"version": "3.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/cache.git",
"reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf",
"reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf",
"shasum": ""
},
"require": {
"php": ">=8.0.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Cache\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common interface for caching libraries",
"keywords": [
"cache",
"psr",
"psr-6"
],
"support": {
"source": "https://github.com/php-fig/cache/tree/3.0.0"
},
"time": "2021-02-03T23:26:27+00:00"
},
{ {
"name": "psr/clock", "name": "psr/clock",
"version": "1.0.0", "version": "1.0.0",
@@ -8009,54 +8212,6 @@
], ],
"time": "2025-08-29T05:28:31+00:00" "time": "2025-08-29T05:28:31+00:00"
}, },
{
"name": "doctrine/deprecations",
"version": "1.1.5",
"source": {
"type": "git",
"url": "https://github.com/doctrine/deprecations.git",
"reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/deprecations/zipball/459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38",
"reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"conflict": {
"phpunit/phpunit": "<=7.5 || >=13"
},
"require-dev": {
"doctrine/coding-standard": "^9 || ^12 || ^13",
"phpstan/phpstan": "1.4.10 || 2.1.11",
"phpstan/phpstan-phpunit": "^1.0 || ^2",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.6 || ^10.5 || ^11.5 || ^12",
"psr/log": "^1 || ^2 || ^3"
},
"suggest": {
"psr/log": "Allows logging deprecations via PSR-3 logger implementation"
},
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\Deprecations\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.",
"homepage": "https://www.doctrine-project.org/",
"support": {
"issues": "https://github.com/doctrine/deprecations/issues",
"source": "https://github.com/doctrine/deprecations/tree/1.1.5"
},
"time": "2025-04-07T20:06:18+00:00"
},
{ {
"name": "fakerphp/faker", "name": "fakerphp/faker",
"version": "v1.24.1", "version": "v1.24.1",
@@ -10127,6 +10282,69 @@
], ],
"time": "2025-09-03T06:25:17+00:00" "time": "2025-09-03T06:25:17+00:00"
}, },
{
"name": "reliese/laravel",
"version": "v1.4.0",
"source": {
"type": "git",
"url": "https://github.com/reliese/laravel.git",
"reference": "2181113d420cae67ec68b6bbe6f325900856d6b9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/reliese/laravel/zipball/2181113d420cae67ec68b6bbe6f325900856d6b9",
"reference": "2181113d420cae67ec68b6bbe6f325900856d6b9",
"shasum": ""
},
"require": {
"doctrine/dbal": ">=2.5",
"illuminate/console": ">=5.1",
"illuminate/contracts": ">=5.1",
"illuminate/database": ">=5.1",
"illuminate/filesystem": ">=5.1",
"illuminate/support": ">=5.1",
"php": "^7.3|^8.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": ">=1.4",
"phpunit/phpunit": "^9"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Reliese\\Coders\\CodersServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Reliese\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Cristian Llanos",
"email": "cristianllanos@outlook.com"
}
],
"description": "Reliese Components for Laravel Framework code generation.",
"homepage": "http://cristianllanos.com",
"keywords": [
"laravel",
"reliese"
],
"support": {
"issues": "https://github.com/reliese/laravel/issues",
"source": "https://github.com/reliese/laravel"
},
"time": "2025-03-20T16:16:48+00:00"
},
{ {
"name": "sebastian/cli-parser", "name": "sebastian/cli-parser",
"version": "4.2.0", "version": "4.2.0",

534
config/models.php Archivo normal
Ver fichero

@@ -0,0 +1,534 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Configurations
|--------------------------------------------------------------------------
|
| In this section you may define the default configuration for each model
| that will be generated from any database.
|
*/
'*' => [
/*
|--------------------------------------------------------------------------
| Model Files Location
|--------------------------------------------------------------------------
|
| We need a location to store your new generated files. All files will be
| placed within this directory. When you turn on base files, they will
| be placed within a Base directory inside this location.
|
*/
'path' => app_path('Models'),
/*
|--------------------------------------------------------------------------
| Model Namespace
|--------------------------------------------------------------------------
|
| Every generated model will belong to this namespace. It is suggested
| that this namespace should follow PSR-4 convention and be very
| similar to the path of your models defined above.
|
*/
'namespace' => 'App\Models',
/*
|--------------------------------------------------------------------------
| Parent Class
|--------------------------------------------------------------------------
|
| All Eloquent models should inherit from Eloquent Model class. However,
| you can define a custom Eloquent model that suits your needs.
| As an example one custom model has been added for you which
| will allow you to create custom database castings.
|
*/
'parent' => Illuminate\Database\Eloquent\Model::class,
/*
|--------------------------------------------------------------------------
| Traits
|--------------------------------------------------------------------------
|
| Sometimes you may want to append certain traits to all your models.
| If that is what you need, you may list them bellow.
| As an example we have a BitBooleans trait which will treat MySQL bit
| data type as booleans. You might probably not need it, but it is
| an example of how you can customize your models.
|
*/
'use' => [
// Reliese\Database\Eloquent\BitBooleans::class,
// Reliese\Database\Eloquent\BlamableBehavior::class,
],
/*
|--------------------------------------------------------------------------
| Model Connection
|--------------------------------------------------------------------------
|
| If you wish your models had appended the connection from which they
| were generated, you should set this value to true and your
| models will have the connection property filled.
|
*/
'connection' => false,
/*
|--------------------------------------------------------------------------
| Timestamps
|--------------------------------------------------------------------------
|
| If your tables have CREATED_AT and UPDATED_AT timestamps you may
| enable them and your models will fill their values as needed.
| You can also specify which fields should be treated as timestamps
| in case you don't follow the naming convention Eloquent uses.
| If your table doesn't have these fields, timestamps will be
| disabled for your model.
|
*/
'timestamps' => true,
// 'timestamps' => [
// 'enabled' => true,
// 'fields' => [
// 'CREATED_AT' => 'created_at',
// 'UPDATED_AT' => 'updated_at',
// ]
// ],
/*
|--------------------------------------------------------------------------
| Soft Deletes
|--------------------------------------------------------------------------
|
| If your tables support soft deletes with a DELETED_AT attribute,
| you can enable them here. You can also specify which field
| should be treated as a soft delete attribute in case you
| don't follow the naming convention Eloquent uses.
| If your table doesn't have this field, soft deletes will be
| disabled for your model.
|
*/
'soft_deletes' => true,
// 'soft_deletes' => [
// 'enabled' => true,
// 'field' => 'deleted_at',
// ],
/*
|--------------------------------------------------------------------------
| Date Format
|--------------------------------------------------------------------------
|
| Here you may define your models' date format. The following format
| is the default format Eloquent uses. You won't see it in your
| models unless you change it to a more convenient value.
|
*/
'date_format' => 'Y-m-d H:i:s',
/*
|--------------------------------------------------------------------------
| Pagination
|--------------------------------------------------------------------------
|
| Here you may define how many models Eloquent should display when
| paginating them. The default number is 15, so you might not
| see this number in your models unless you change it.
|
*/
'per_page' => 15,
/*
|--------------------------------------------------------------------------
| Base Files
|--------------------------------------------------------------------------
|
| By default, your models will be generated in your models path, but
| when you generate them again they will be replaced by new ones.
| You may want to customize your models and, at the same time, be
| able to generate them as your tables change. For that, you
| can enable base files. These files will be replaced whenever
| you generate them, but your customized files will not be touched.
|
*/
'base_files' => false,
/*
|--------------------------------------------------------------------------
| Snake Attributes
|--------------------------------------------------------------------------
|
| Eloquent treats your model attributes as snake cased attributes, but
| if you have camel-cased fields in your database you can disable
| that behaviour and use camel case attributes in your models.
|
*/
'snake_attributes' => true,
/*
|--------------------------------------------------------------------------
| Indent options
|--------------------------------------------------------------------------
|
| As default indention is done with tabs, but you can change it by setting
| this to the amount of spaces you that you want to use for indentation.
| Usually you will use 4 spaces instead of tabs.
|
*/
'indent_with_space' => 0,
/*
|--------------------------------------------------------------------------
| Qualified Table Names
|--------------------------------------------------------------------------
|
| If some of your tables have cross-database relationships (probably in
| MySQL), you can make sure your models take into account their
| respective database schema.
|
| Can Either be NULL, FALSE or TRUE
| TRUE: Schema name will be prepended on the table
| FALSE:Table name will be set without schema name.
| NULL: Table name will follow laravel pattern,
| i.e. if class name(plural) matches table name, then table name will not be added
*/
'qualified_tables' => false,
/*
|--------------------------------------------------------------------------
| Hidden Attributes
|--------------------------------------------------------------------------
|
| When casting your models into arrays or json, the need to hide some
| attributes sometimes arise. If your tables have some fields you
| want to hide, you can define them bellow.
| Some fields were defined for you.
|
*/
'hidden' => [
'*secret*', '*password', '*token',
],
/*
|--------------------------------------------------------------------------
| Mass Assignment Guarded Attributes
|--------------------------------------------------------------------------
|
| You may want to protect some fields from mass assignment. You can
| define them bellow. Some fields were defined for you.
| Your fillable attributes will be those which are not in the list
| excluding your models' primary keys.
|
*/
'guarded' => [
// 'created_by', 'updated_by'
],
/*
|--------------------------------------------------------------------------
| Casts
|--------------------------------------------------------------------------
|
| You may want to specify which of your table fields should be cast as
| something other than a string. For instance, you may want a
| text field be cast as an array or and object.
|
| You may define column patterns which will be cast using the value
| assigned. We have defined some fields for you. Feel free to
| modify them to fit your needs.
|
*/
'casts' => [
'*_json' => 'json',
],
/*
|--------------------------------------------------------------------------
| Excluded Tables
|--------------------------------------------------------------------------
|
| When performing the generation of models you may want to skip some of
| them, because you don't want a model for them or any other reason.
| You can define those tables bellow. The migrations table was
| filled for you, since you may not want a model for it.
|
*/
'except' => [
'migrations',
'failed_jobs',
'password_resets',
'personal_access_tokens',
'password_reset_tokens',
],
/*
|--------------------------------------------------------------------------
| Specified Tables
|--------------------------------------------------------------------------
|
| You can specify specific tables. This will generate the models only
| for selected tables, ignoring the rest.
|
*/
'only' => [
// 'users',
],
/*
|--------------------------------------------------------------------------
| Table Prefix
|--------------------------------------------------------------------------
|
| If you have a prefix on your table names but don't want it in the model
| and relation names, specify it here.
|
*/
'table_prefix' => '',
/*
|--------------------------------------------------------------------------
| Lower table name before doing studly
|--------------------------------------------------------------------------
|
| If tables names are capitalised using studly produces incorrect name
| this can help fix it ie TABLE_NAME now becomes TableName
|
*/
'lower_table_name_first' => false,
/*
|--------------------------------------------------------------------------
| Model Names
|--------------------------------------------------------------------------
|
| By default the generator will create models with names that match your tables.
| However, if you wish to manually override the naming, you can specify a mapping
| here between table and model names.
|
| Example:
| A table called 'billing_invoices' will generate a model called `BillingInvoice`,
| but you'd prefer it to generate a model called 'Invoice'. Therefore, you'd add
| the following array key and value:
| 'billing_invoices' => 'Invoice',
*/
'model_names' => [
],
/*
|--------------------------------------------------------------------------
| Relation Name Strategy
|--------------------------------------------------------------------------
|
| How the relations should be named in your models.
|
| 'related' Use the related table as the relation name.
| (post.author --> user.id)
generates Post::user() and User::posts()
|
| 'foreign_key' Use the foreign key as the relation name.
| This can help to provide more meaningful relationship names, and avoids naming conflicts
| if you have more than one relationship between two tables.
| (post.author_id --> user.id)
| generates Post::author() and User::posts_where_author()
| (post.editor_id --> user.id)
| generates Post::editor() and User::posts_where_editor()
| ID suffixes can be omitted from foreign keys.
| (post.author --> user.id)
| (post.editor --> user.id)
| generates the same as above.
| Where the foreign key matches the related table name, it behaves as per the 'related' strategy.
| (post.user_id --> user.id)
| generates Post::user() and User::posts()
*/
'relation_name_strategy' => 'related',
// 'relation_name_strategy' => 'foreign_key',
/*
|--------------------------------------------------------------------------
| Determines need or not to generate constants with properties names like
|
| ...
| const AGE = 'age';
| const USER_NAME = 'user_name';
| ...
|
| that later can be used in QueryBuilder like
|
| ...
| $builder->select([User::USER_NAME])->where(User::AGE, '<=', 18);
| ...
|
| that helps to avoid typos in strings when typing field names and allows to use
| code competition with available model's field names.
*/
'with_property_constants' => false,
/*
|--------------------------------------------------------------------------
| Optionally includes a full list of columns in the base generated models,
| which can be used to avoid making calls like
|
| ...
| \Illuminate\Support\Facades\Schema::getColumnListing
| ...
|
| which can be slow, especially for large tables.
*/
'with_column_list' => false,
/*
|--------------------------------------------------------------------------
| Disable Pluralization Name
|--------------------------------------------------------------------------
|
| You can disable pluralization tables and relations
|
*/
'pluralize' => true,
/*
|--------------------------------------------------------------------------
| Disable Pluralization Except For Certain Tables
|--------------------------------------------------------------------------
|
| You can enable pluralization for certain tables
|
*/
'override_pluralize_for' => [
],
/*
|--------------------------------------------------------------------------
| Move $hidden property to base files
|--------------------------------------------------------------------------
| When base_files is true you can set hidden_in_base_files to true
| if you want the $hidden to be generated in base files
|
*/
'hidden_in_base_files' => false,
/*
|--------------------------------------------------------------------------
| Move $fillable property to base files
|--------------------------------------------------------------------------
| When base_files is true you can set fillable_in_base_files to true
| if you want the $fillable to be generated in base files
|
*/
'fillable_in_base_files' => false,
/*
|--------------------------------------------------------------------------
| Generate return types for relation methods.
|--------------------------------------------------------------------------
| When enable_return_types is set to true, return type declarations are added
| to all generated relation methods for your models.
|
| NOTE: This requires PHP 7.0 or later.
|
*/
'enable_return_types' => false,
],
/*
|--------------------------------------------------------------------------
| Database Specifics
|--------------------------------------------------------------------------
|
| In this section you may define the default configuration for each model
| that will be generated from a specific database. You can also nest
| table specific configurations.
| These values will override those defined in the section above.
|
*/
// 'shop' => [
// 'path' => app_path(),
// 'namespace' => 'App',
// 'snake_attributes' => false,
// 'qualified_tables' => true,
// 'use' => [
// Reliese\Database\Eloquent\BitBooleans::class,
// ],
// 'except' => ['migrations'],
// 'only' => ['users'],
// // Table Specifics Bellow:
// 'user' => [
// // Don't use any default trait
// 'use' => [],
// ]
// ],
/*
|--------------------------------------------------------------------------
| Connection Specifics
|--------------------------------------------------------------------------
|
| In this section you may define the default configuration for each model
| that will be generated from a specific connection. You can also nest
| database and table specific configurations.
|
| You may wish to use connection specific config for setting a parent
| model with a read only setup, or enforcing a different set of rules
| for a connection, e.g. using snake_case naming over CamelCase naming.
|
| This supports nesting with the following key configuration values, in
| reverse precedence order (i.e. the last one found becomes the value).
|
| connections.{connection_name}.property
| connections.{connection_name}.{database_name}.property
| connections.{connection_name}.{table_name}.property
| connections.{connection_name}.{database_name}.{table_name}.property
|
| These values will override those defined in the section above.
|
*/
// 'connections' => [
// 'read_only_external' => [
// 'parent' => \App\Models\ReadOnlyModel::class,
// 'connection' => true,
// 'users' => [
// 'connection' => false,
// ],
// 'my_other_database' => [
// 'password_resets' => [
// 'connection' => false,
// ]
// ]
// ],
// ],
];

Ver fichero

@@ -1 +0,0 @@
*.sqlite*

Archivo binario no mostrado.

Ver fichero

@@ -1,15 +0,0 @@
<html>
<body>
<h1>Buscador</h1>
<form action="/buscador" method="post">
@csrf
<input name="contenido" type="text">
<button type="submit">Buscar</button>
</form>
@error('contenido')
<div style="color: red;">{{ $message }}</div>
@enderror
</body>
</html>

Ver fichero

@@ -1,9 +0,0 @@
<div>
<livewire:contador />
<livewire:contador />
<livewire:buscador />
@livewireScripts
</div>

Ver fichero

@@ -1,19 +0,0 @@
<div>
<input type="text" name="nombreABuscar" wire:model="nombre">
<button wire:click="buscar"> Buscar </button>
@error('nombre')
{{ $message }}
@enderror
<ul>
@forelse ($resultados as $album)
<li>{{ $album->Title }} - {{ $album->artista->Name }} </li>
@empty
No se encontraron resultados
@endforelse
</ul>
</div>

Ver fichero

@@ -1,7 +0,0 @@
<div>
<h1>{{ $cantidad }}</h1>
<button wire:click="incrementar">+</button>
<button wire:click="decrementar">-</button>
</div>

Ver fichero

@@ -1,8 +0,0 @@
<html>
<body>
<h1>Página 1</h1>
<p>Hola a {{ $nombrePersona }}!</p>
</body>
</html>

Ver fichero

@@ -1,3 +0,0 @@
<x-layouts.app title="Página de Inicio">
<p class="font-bold text-red-500">Este es el contenido de la página de inicio.</p>
</x-layouts.app>

Las diferiencias del archivo han sido suprimidas porque una o mas lineas son muy largas

Ver fichero

@@ -1,110 +1,7 @@
<?php <?php
use App\Http\Controllers\BuscadorController;
use App\Http\Controllers\SaludoController;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use App\Models\Artista;
use App\Models\Playlist;
use App\Models\Track;
Route::get('/', function () { Route::get('/', function () {
return view('welcome'); return view('welcome');
}); });
Route::get('/html/{nombre}', SaludoController::class );
Route::get('/prueba', function(Request $request){
dd($request);
});
Route::get('/html', function(){
return '
<html>
<body>
<h1>Página 1</h1>
<p>Hola a todos!</p>
</body>
</html>
';
})->name('miprimerhtml');
//Segunda versión usando views
// Si es invokable
Route::get('/html/{nombre}', SaludoController::class);
Route::get('/buscador', [BuscadorController::class, 'mostrarBuscador']);
Route::post('/buscador', [BuscadorController::class, 'procesarFormulario']);
Route::get('/ejer1', function(){
return DB::table('artists')->get();
});
Route::get('/ejer6', function(Request $request){
return DB::table('customers')->where('CustomerId', $request->input('id'))->firstOrFail();
});
Route::get('/ejer7', function(Request $request){
return DB::table('albums')
->join('artists', 'albums.ArtistId', '=', 'artists.ArtistId')
->get();
});
Route::get('/listado/{artista}', function(Artista $artista){
$artista = Artista::find(2);
$albumCreado = $artista->albumes()->create([
'Title' => "El nuevo album"
]);
});
Route::get('/ejer9', function(){
$artistas = DB::table('artists')
->leftJoin('albums', 'artists.ArtistId', '=', 'albums.ArtistId')
->whereNull('albums.AlbumId')
->select('artists.*')
->get();
return $artistas;
});
Route::get('/listado/{artista}/editar', function(Request $request, Artista $artista){
$artista->name = $request->input('nombre');
$artista->save();
return "Modelo actualizado";
});
Route::get('/listado/{artista}/eliminar', function(Request $request, Artista $artista){
$artista->delete();
return "Modelo eliminado";
});
Route::get('/listadoPlaylist', function(){
$track = Track::find(4);
return $track->playlists;
});
Route::get('/asociar', function(){
$track = Track::find(4);
$playlist = Playlist::find(18);
return $track->playlists()->attach($playlist);
});
Route::get('/componentes', function(){
return view('componentes');
});
Route::get('test', function(){
return view('test');
});