Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Practica subida
- Loading branch information
1 parent
c760f17
commit dfe3cdd
Showing
220 changed files
with
90,550 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,33 @@ | |||
APP_NAME=Laravel | |||
APP_ENV=local | |||
APP_KEY=base64:V/C4jE+761fUo9Q7svGoPZAHrT4MsVcq600l8yIsN/0= | |||
APP_DEBUG=true | |||
APP_LOG_LEVEL=debug | |||
APP_URL=http://localhost | |||
|
|||
DB_CONNECTION=mysql | |||
DB_HOST=127.0.0.1 | |||
DB_PORT=3306 | |||
DB_DATABASE=netflix | |||
DB_USERNAME=netflix | |||
DB_PASSWORD=netflix | |||
|
|||
BROADCAST_DRIVER=log | |||
CACHE_DRIVER=file | |||
SESSION_DRIVER=file | |||
QUEUE_DRIVER=sync | |||
|
|||
REDIS_HOST=127.0.0.1 | |||
REDIS_PASSWORD=null | |||
REDIS_PORT=6379 | |||
|
|||
MAIL_DRIVER=smtp | |||
MAIL_HOST=smtp.mailtrap.io | |||
MAIL_PORT=2525 | |||
MAIL_USERNAME=null | |||
MAIL_PASSWORD=null | |||
MAIL_ENCRYPTION=null | |||
|
|||
PUSHER_APP_ID= | |||
PUSHER_APP_KEY= | |||
PUSHER_APP_SECRET= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,5 @@ | |||
* text=auto | |||
*.css linguist-vendored | |||
*.scss linguist-vendored | |||
*.js linguist-vendored | |||
CHANGELOG.md export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,12 @@ | |||
/node_modules | |||
/public/hot | |||
/public/storage | |||
/storage/*.key | |||
/vendor | |||
/.idea | |||
/.vagrant | |||
Homestead.json | |||
Homestead.yaml | |||
npm-debug.log | |||
yarn-error.log | |||
.env |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,23 @@ | |||
<?php | |||
|
|||
namespace App; | |||
use App\Serie; | |||
|
|||
use Illuminate\Database\Eloquent\Model; | |||
|
|||
class Actor extends Model | |||
{ | |||
|
|||
public static function createActor($request) { | |||
if($request->has('name')){ | |||
$actor = new Actor(); | |||
$actor->name = $request->name; | |||
$actor->save(); | |||
} | |||
} | |||
|
|||
public function serie() { | |||
return $this->belongsToMany('App\Serie'); | |||
} | |||
|
|||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,21 @@ | |||
<?php | |||
|
|||
namespace App; | |||
|
|||
use Illuminate\Database\Eloquent\Model; | |||
|
|||
class Category extends Model | |||
{ | |||
public static function createCategory($request) { | |||
if($request->has('category')){ | |||
$category = new Category(); | |||
$category->category = $request->category; | |||
$category->save(); | |||
} | |||
} | |||
|
|||
public function series() | |||
{ | |||
return $this->belongsToMany('App\Serie','category_serie'); | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,31 @@ | |||
<?php | |||
|
|||
namespace App; | |||
use App\Serie; | |||
use Illuminate\Database\Eloquent\Model; | |||
|
|||
class Chapter extends Model | |||
{ | |||
|
|||
public static function create($s,$season,$title,$desc) { | |||
$c = new Chapter(); | |||
$c->title = $title; | |||
$c->description = $desc; | |||
$c->season = $season; | |||
|
|||
$c->serie()->associate($s); | |||
$c->save(); | |||
} | |||
public static function deleteChapters($id,$season){ | |||
$chapters = Chapter::where('season',$season)->where('serie_id',$id)->get(); | |||
|
|||
foreach($chapters as $c){ | |||
$c->delete(); | |||
} | |||
} | |||
|
|||
public function serie() | |||
{ | |||
return $this->belongsTo('App\Serie'); | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,40 @@ | |||
<?php | |||
|
|||
namespace App\Console; | |||
|
|||
use Illuminate\Console\Scheduling\Schedule; | |||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel; | |||
|
|||
class Kernel extends ConsoleKernel | |||
{ | |||
/** | |||
* The Artisan commands provided by your application. | |||
* | |||
* @var array | |||
*/ | |||
protected $commands = [ | |||
// | |||
]; | |||
|
|||
/** | |||
* Define the application's command schedule. | |||
* | |||
* @param \Illuminate\Console\Scheduling\Schedule $schedule | |||
* @return void | |||
*/ | |||
protected function schedule(Schedule $schedule) | |||
{ | |||
// $schedule->command('inspire') | |||
// ->hourly(); | |||
} | |||
|
|||
/** | |||
* Register the Closure based commands for the application. | |||
* | |||
* @return void | |||
*/ | |||
protected function commands() | |||
{ | |||
require base_path('routes/console.php'); | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,21 @@ | |||
<?php | |||
|
|||
namespace App; | |||
|
|||
use Illuminate\Database\Eloquent\Model; | |||
|
|||
class Director extends Model | |||
{ | |||
public static function createDirector($request) { | |||
$dir = new Director(); | |||
if($request->has('name')){ | |||
$dir->name = $request->name; | |||
$dir->save(); | |||
} | |||
} | |||
|
|||
public function series() | |||
{ | |||
return $this->hasMany('App\Serie'); | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,65 @@ | |||
<?php | |||
|
|||
namespace App\Exceptions; | |||
|
|||
use Exception; | |||
use Illuminate\Auth\AuthenticationException; | |||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; | |||
|
|||
class Handler extends ExceptionHandler | |||
{ | |||
/** | |||
* A list of the exception types that should not be reported. | |||
* | |||
* @var array | |||
*/ | |||
protected $dontReport = [ | |||
\Illuminate\Auth\AuthenticationException::class, | |||
\Illuminate\Auth\Access\AuthorizationException::class, | |||
\Symfony\Component\HttpKernel\Exception\HttpException::class, | |||
\Illuminate\Database\Eloquent\ModelNotFoundException::class, | |||
\Illuminate\Session\TokenMismatchException::class, | |||
\Illuminate\Validation\ValidationException::class, | |||
]; | |||
|
|||
/** | |||
* Report or log an exception. | |||
* | |||
* This is a great spot to send exceptions to Sentry, Bugsnag, etc. | |||
* | |||
* @param \Exception $exception | |||
* @return void | |||
*/ | |||
public function report(Exception $exception) | |||
{ | |||
parent::report($exception); | |||
} | |||
|
|||
/** | |||
* Render an exception into an HTTP response. | |||
* | |||
* @param \Illuminate\Http\Request $request | |||
* @param \Exception $exception | |||
* @return \Illuminate\Http\Response | |||
*/ | |||
public function render($request, Exception $exception) | |||
{ | |||
return parent::render($request, $exception); | |||
} | |||
|
|||
/** | |||
* Convert an authentication exception into an unauthenticated response. | |||
* | |||
* @param \Illuminate\Http\Request $request | |||
* @param \Illuminate\Auth\AuthenticationException $exception | |||
* @return \Illuminate\Http\Response | |||
*/ | |||
protected function unauthenticated($request, AuthenticationException $exception) | |||
{ | |||
if ($request->expectsJson()) { | |||
return response()->json(['error' => 'Unauthenticated.'], 401); | |||
} | |||
|
|||
return redirect()->guest(route('login')); | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,47 @@ | |||
<?php | |||
|
|||
namespace App\Http\Controllers; | |||
|
|||
use Illuminate\Http\Request; | |||
use App\Actor; | |||
|
|||
class ActorController extends Controller | |||
{ | |||
|
|||
public function index() | |||
{ | |||
return view('admin.newActor'); | |||
} | |||
|
|||
public function editActor() | |||
{ | |||
$actor = Actor::all(); | |||
return view('admin.editActor', ['actors' => $actor]); | |||
} | |||
|
|||
public function deleteActor() | |||
{ | |||
$actor = Actor::all(); | |||
return view('admin.deleteActor', ['actors' => $actor]); | |||
} | |||
|
|||
public function create(Request $request) | |||
{ | |||
Actor::createActor($request); | |||
return redirect()->action('ActorController@index'); | |||
} | |||
|
|||
public function edit(Request $request) | |||
{ | |||
$d = Actor::find($request->id); | |||
$d->name = $request->name; | |||
$d->save(); | |||
return redirect()->action('ActorController@editActor'); | |||
} | |||
|
|||
public function delete(Request $request){ | |||
$dir = Actor::find($request->actor); | |||
$dir->delete(); | |||
return redirect()->action('ActorController@deleteActor'); | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,32 @@ | |||
<?php | |||
|
|||
namespace App\Http\Controllers; | |||
|
|||
use Illuminate\Http\Request; | |||
use App\Serie; | |||
use App\Category; | |||
use Illuminate\Support\Facades\DB; | |||
|
|||
class AdminController extends Controller | |||
{ | |||
/** | |||
* Create a new controller instance. | |||
* | |||
* @return void | |||
*/ | |||
public function __construct() | |||
{ | |||
$this->middleware('auth'); | |||
} | |||
|
|||
/** | |||
* Show the application dashboard. | |||
* | |||
* @return \Illuminate\Http\Response | |||
*/ | |||
public function index() | |||
{ | |||
return view('admin.admin'); | |||
} | |||
|
|||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,32 @@ | |||
<?php | |||
|
|||
namespace App\Http\Controllers\Auth; | |||
|
|||
use App\Http\Controllers\Controller; | |||
use Illuminate\Foundation\Auth\SendsPasswordResetEmails; | |||
|
|||
class ForgotPasswordController extends Controller | |||
{ | |||
/* | |||
|-------------------------------------------------------------------------- | |||
| Password Reset Controller | |||
|-------------------------------------------------------------------------- | |||
| | |||
| This controller is responsible for handling password reset emails and | |||
| includes a trait which assists in sending these notifications from | |||
| your application to your users. Feel free to explore this trait. | |||
| | |||
*/ | |||
|
|||
use SendsPasswordResetEmails; | |||
|
|||
/** | |||
* Create a new controller instance. | |||
* | |||
* @return void | |||
*/ | |||
public function __construct() | |||
{ | |||
$this->middleware('guest'); | |||
} | |||
} |
Oops, something went wrong.