Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
895fcc3
EC2M-20-Controlador-Shared
lauracastilloal97 May 26, 2021
61b76ae
Delete d3326be690f05ace3b2e1c96275f1a763a07468c.jpg
lauracastilloal97 May 27, 2021
2b51334
Delete 35b235ab346c54be607b3cd1746c8c6738459272.jpg
lauracastilloal97 May 27, 2021
b380a23
Delete 1eb825babb93a3c1fb69d9a8f47717f2a01620de.png
lauracastilloal97 May 27, 2021
3ba7677
Delete 8558141c8c245badb48a70388c5148c0a94a5940.png
lauracastilloal97 May 27, 2021
bafc430
Delete a2b017aea3b5f0620da97e059e3afc6c92e58014.png
lauracastilloal97 May 27, 2021
760f50a
Delete a884b8a2ac26774c5efcec61e14129fd20c51d3a.png
lauracastilloal97 May 27, 2021
c76a243
Archivo ignorar elementos
lauracastilloal97 May 27, 2021
b6a8b61
Delete d3326be690f05ace3b2e1c96275f1a763a07468c.jpg
lauracastilloal97 May 31, 2021
83ae9ef
Delete 35b235ab346c54be607b3cd1746c8c6738459272.jpg
lauracastilloal97 May 31, 2021
16e9855
Delete 1eb825babb93a3c1fb69d9a8f47717f2a01620de.png
lauracastilloal97 May 31, 2021
65e3798
Delete 8558141c8c245badb48a70388c5148c0a94a5940.png
lauracastilloal97 May 31, 2021
49fb65c
Delete a2b017aea3b5f0620da97e059e3afc6c92e58014.png
lauracastilloal97 May 31, 2021
29e2dcf
Delete a884b8a2ac26774c5efcec61e14129fd20c51d3a.png
lauracastilloal97 May 31, 2021
1d893d6
Delete laravel.log
lauracastilloal97 May 31, 2021
45ef01d
Delete 44d142505dd1a3b497197e2f459d2aec779e9ed6
lauracastilloal97 May 31, 2021
6b7acfc
Delete c24f92750673b2169c8cb7bfbc999cfa8457dc7c
lauracastilloal97 May 31, 2021
d818f1c
Update MachineSharedUrl.php
lauracastilloal97 May 31, 2021
d59af86
Update .gitignore
lauracastilloal97 May 31, 2021
0dd1fa5
EC2M-20 Subida archivos controlador
lauracastilloal97 Jun 8, 2021
f7f6ed2
Delete listado.blade.php
lauracastilloal97 Jun 8, 2021
6510803
Update MachineSharedUrlController.php
lauracastilloal97 Jun 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions app/Http/Controllers/MachineSharedUrlController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace App\Http\Controllers;


use App\Models\MachineSharedUrl;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

class MachineSharedUrlController extends Controller
{

public function show($url, Request $request)
{
$sharedUrls= \DB::table('machinesharedurls')->select('url', 'title', 'text', 'image')->get();
return view('sharedUrl', compact('sharedUrls'));
}


}
4 changes: 3 additions & 1 deletion app/Models/MachineSharedUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Orchid\Attachment\Attachable;
use Orchid\Attachment\Models\Attachment;
use Orchid\Screen\AsSource;

class MachineSharedUrl extends Model
{
public $table = "machinesharedurls";
use AsSource;
use AsSource, Attachable;

/**
* @var array
Expand Down
13 changes: 10 additions & 3 deletions app/Orchid/Screens/MachineSharedUrlEditScreen.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Orchid\Screen\Fields\DateTimer;
use Orchid\Screen\Fields\TextArea;
use Orchid\Screen\Fields\Relation;
use Orchid\Screen\Fields\Picture;
use Orchid\Screen\Fields\Cropper;
use Orchid\Screen\Fields\Upload;
use Orchid\Support\Facades\Layout;
use Orchid\Screen\Actions\Button;
Expand Down Expand Up @@ -52,6 +52,8 @@ public function query(MachineSharedUrl $machinesharedurl): array
$this->name = 'Edit machine shared url';
}

$machinesharedurl->load('attachment');

return [
'machinesharedurl' => $machinesharedurl
];
Expand Down Expand Up @@ -103,8 +105,9 @@ public function layout(): array
->title('End date')
->format('Y-m-d'),

Picture::make('machinesharedurl.image')
->title('Image'),
Cropper::make('machinesharedurl.image')
->title('Image')
->targetRelativeUrl(),

TextArea::make('machinesharedurl.text')
->title('Text'),
Expand All @@ -130,6 +133,10 @@ public function createOrUpdate(MachineSharedUrl $machinesharedurl, Request $requ
{
$machinesharedurl->fill($request->get('machinesharedurl'))->save();

$machinesharedurl->attachment()->syncWithoutDetaching(
$request->input('machinesharedurl.attachment', [])
);

Alert::info('You have successfully created an machine shared url.');

return redirect()->route('platform.machinesharedurl.list');
Expand Down
27 changes: 27 additions & 0 deletions resources/views/sharedUrl.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Shared Url</title>
</head>
<body>
<section>

<div>
<div>

<ul>
<li>Nombre: {{$sharedUrls->title}}</li>
<li>Texto: {{$sharedUrls->text}}</li>
@if ($sharedUrls->image)
<li>Imagen: <img src="{{$sharedUrls->image}}" width="150" height="150"></li>
@endif
</ul>

</div>
</div>
</section>
</body>
</html>
3 changes: 3 additions & 0 deletions routes/web.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\MachineSharedUrlController;

/*
|--------------------------------------------------------------------------
Expand All @@ -16,3 +17,5 @@
Route::get('/', function () {
return view('welcome');
});

Route::get('/{url}',[MachineSharedUrlController::class, 'show']);

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a:5:{s:6:"_token";s:40:"cRZLX1NwcYLMw6imlvzF4pYFUsAwr4GJnXvJsxdn";s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}s:50:"login_web_59ba36addc2b2f9401580f014c7f58ea4e30989d";i:1;s:9:"_previous";a:1:{s:3:"url";s:23:"http://127.0.0.1:8000/5";}s:18:"flash_notification";a:0:{}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@


<?php $__env->startSection('title', __('Not Found')); ?>
<?php $__env->startSection('code', '404'); ?>
<?php $__env->startSection('message', __('Not Found')); ?>

<?php echo $__env->make('errors::minimal', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\ec2-manager\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions/views/404.blade.php ENDPATH**/ ?>
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<title><?php echo $__env->yieldContent('title'); ?></title>

<!-- Fonts -->
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Nunito&display=swap" rel="stylesheet">

<style>
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}a{background-color:transparent}code{font-family:monospace,monospace;font-size:1em}[hidden]{display:none}html{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}*,:after,:before{box-sizing:border-box;border:0 solid #e2e8f0}a{color:inherit;text-decoration:inherit}code{font-family:Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}svg,video{display:block;vertical-align:middle}video{max-width:100%;height:auto}.bg-white{--bg-opacity:1;background-color:#fff;background-color:rgba(255,255,255,var(--bg-opacity))}.bg-gray-100{--bg-opacity:1;background-color:#f7fafc;background-color:rgba(247,250,252,var(--bg-opacity))}.border-gray-200{--border-opacity:1;border-color:#edf2f7;border-color:rgba(237,242,247,var(--border-opacity))}.border-gray-400{--border-opacity:1;border-color:#cbd5e0;border-color:rgba(203,213,224,var(--border-opacity))}.border-t{border-top-width:1px}.border-r{border-right-width:1px}.flex{display:flex}.grid{display:grid}.hidden{display:none}.items-center{align-items:center}.justify-center{justify-content:center}.font-semibold{font-weight:600}.h-5{height:1.25rem}.h-8{height:2rem}.h-16{height:4rem}.text-sm{font-size:.875rem}.text-lg{font-size:1.125rem}.leading-7{line-height:1.75rem}.mx-auto{margin-left:auto;margin-right:auto}.ml-1{margin-left:.25rem}.mt-2{margin-top:.5rem}.mr-2{margin-right:.5rem}.ml-2{margin-left:.5rem}.mt-4{margin-top:1rem}.ml-4{margin-left:1rem}.mt-8{margin-top:2rem}.ml-12{margin-left:3rem}.-mt-px{margin-top:-1px}.max-w-xl{max-width:36rem}.max-w-6xl{max-width:72rem}.min-h-screen{min-height:100vh}.overflow-hidden{overflow:hidden}.p-6{padding:1.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.pt-8{padding-top:2rem}.fixed{position:fixed}.relative{position:relative}.top-0{top:0}.right-0{right:0}.shadow{box-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px 0 rgba(0,0,0,.06)}.text-center{text-align:center}.text-gray-200{--text-opacity:1;color:#edf2f7;color:rgba(237,242,247,var(--text-opacity))}.text-gray-300{--text-opacity:1;color:#e2e8f0;color:rgba(226,232,240,var(--text-opacity))}.text-gray-400{--text-opacity:1;color:#cbd5e0;color:rgba(203,213,224,var(--text-opacity))}.text-gray-500{--text-opacity:1;color:#a0aec0;color:rgba(160,174,192,var(--text-opacity))}.text-gray-600{--text-opacity:1;color:#718096;color:rgba(113,128,150,var(--text-opacity))}.text-gray-700{--text-opacity:1;color:#4a5568;color:rgba(74,85,104,var(--text-opacity))}.text-gray-900{--text-opacity:1;color:#1a202c;color:rgba(26,32,44,var(--text-opacity))}.uppercase{text-transform:uppercase}.underline{text-decoration:underline}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.tracking-wider{letter-spacing:.05em}.w-5{width:1.25rem}.w-8{width:2rem}.w-auto{width:auto}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}@-webkit-keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@-webkit-keyframes ping{0%{transform:scale(1);opacity:1}75%,to{transform:scale(2);opacity:0}}@keyframes ping{0%{transform:scale(1);opacity:1}75%,to{transform:scale(2);opacity:0}}@-webkit-keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}@-webkit-keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:translateY(0);-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}@keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:translateY(0);-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}@media (min-width:640px){.sm\:rounded-lg{border-radius:.5rem}.sm\:block{display:block}.sm\:items-center{align-items:center}.sm\:justify-start{justify-content:flex-start}.sm\:justify-between{justify-content:space-between}.sm\:h-20{height:5rem}.sm\:ml-0{margin-left:0}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:pt-0{padding-top:0}.sm\:text-left{text-align:left}.sm\:text-right{text-align:right}}@media (min-width:768px){.md\:border-t-0{border-top-width:0}.md\:border-l{border-left-width:1px}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width:1024px){.lg\:px-8{padding-left:2rem;padding-right:2rem}}@media (prefers-color-scheme:dark){.dark\:bg-gray-800{--bg-opacity:1;background-color:#2d3748;background-color:rgba(45,55,72,var(--bg-opacity))}.dark\:bg-gray-900{--bg-opacity:1;background-color:#1a202c;background-color:rgba(26,32,44,var(--bg-opacity))}.dark\:border-gray-700{--border-opacity:1;border-color:#4a5568;border-color:rgba(74,85,104,var(--border-opacity))}.dark\:text-white{--text-opacity:1;color:#fff;color:rgba(255,255,255,var(--text-opacity))}.dark\:text-gray-400{--text-opacity:1;color:#cbd5e0;color:rgba(203,213,224,var(--text-opacity))}}
</style>

<style>
body {
font-family: 'Nunito', sans-serif;
}
</style>
</head>
<body class="antialiased">
<div class="relative flex items-top justify-center min-h-screen bg-gray-100 dark:bg-gray-900 sm:items-center sm:pt-0">
<div class="max-w-xl mx-auto sm:px-6 lg:px-8">
<div class="flex items-center pt-8 sm:justify-start sm:pt-0">
<div class="px-4 text-lg text-gray-500 border-r border-gray-400 tracking-wider">
<?php echo $__env->yieldContent('code'); ?>
</div>

<div class="ml-4 text-lg text-gray-500 uppercase tracking-wider">
<?php echo $__env->yieldContent('message'); ?>
</div>
</div>
</div>
</div>
</body>
</html>
<?php /**PATH C:\xampp\htdocs\ec2-manager\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions/views/minimal.blade.php ENDPATH**/ ?>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Shared Url</title>
</head>
<body>
<section>

<div>
<div>

<ul>
<li>Nombre: <?php echo e($sharedurl->title); ?></li>
<li>Texto: <?php echo e($sharedurl->text); ?></li>
<?php if($sharedurl->image): ?>
<li>Imágen: <img src="<?php echo e($sharedurl->image); ?>" width="150" height="150"></li>
<?php endif; ?>

</ul>


</div>
</div>
</section>
</body>
</html><?php /**PATH C:\xampp\htdocs\ec2-manager\resources\views/sharedUrl.blade.php ENDPATH**/ ?>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php $__env->startComponent($typeForm, get_defined_vars()); ?>
<textarea <?php echo e($attributes); ?>><?php echo e($value ?? ''); ?></textarea>
<?php if (isset($__componentOriginal022c3adc7a3ddf487615f02d89190e3aa95e3b2d)): ?>
<?php $component = $__componentOriginal022c3adc7a3ddf487615f02d89190e3aa95e3b2d; ?>
<?php unset($__componentOriginal022c3adc7a3ddf487615f02d89190e3aa95e3b2d); ?>
<?php endif; ?>
<?php echo $__env->renderComponent(); ?>
<?php /**PATH C:\xampp\htdocs\ec2-manager\vendor\orchid\platform\resources\views/fields/textarea.blade.php ENDPATH**/ ?>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Listado de Shared Url</title>
</head>
<body>
<section>

<div>
<div>
<h1>Listado de Shared Url</h1>
<?php $__currentLoopData = $sharedUrls; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $sharedUrl): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<ul>
<li><a href="<?php echo e($sharedUrl->id); ?>"><?php echo e($sharedUrl->url); ?></a></li>
</ul>

<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
</div>
</section>
</body>
</html><?php /**PATH C:\xampp\htdocs\ec2-manager\resources\views/listado.blade.php ENDPATH**/ ?>
Loading