Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Hayk committed Sep 26, 2019
0 parents commit 9bde00a
Show file tree
Hide file tree
Showing 473 changed files with 33,082 additions and 0 deletions.
14 changes: 14 additions & 0 deletions app/AboutAS.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class AboutAS extends Model
{
protected $table = 'about_as';

protected $fillable = [
'text'
];
}
15 changes: 15 additions & 0 deletions app/AsphaltImage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class AsphaltImage extends Model
{
protected $table = 'asphalt_images';

protected $fillable = [
'name', 'img',
];

}
42 changes: 42 additions & 0 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?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 commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');

require base_path('routes/console.php');
}
}
14 changes: 14 additions & 0 deletions app/Contact.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Contact extends Model
{
protected $table = 'contacts';

protected $fillable = [
'phone', 'fax', 'email', 'address',
];
}
51 changes: 51 additions & 0 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

namespace App\Exceptions;

use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;

class Handler extends ExceptionHandler
{
/**
* A list of the exception types that are not reported.
*
* @var array
*/
protected $dontReport = [
//
];

/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array
*/
protected $dontFlash = [
'password',
'password_confirmation',
];

/**
* Report or log an exception.
*
* @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);
}
}
14 changes: 14 additions & 0 deletions app/HomeUl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class HomeUl extends Model
{
protected $table = 'home_ul';

protected $fillable = [
'left_name', 'right_name'
];
}
14 changes: 14 additions & 0 deletions app/Homedata.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Homedata extends Model
{
protected $table = 'home_data';

protected $fillable = [
'name', 'description'
];
}
128 changes: 128 additions & 0 deletions app/Http/Controllers/AdminController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
<?php

namespace App\Http\Controllers;

use App\Contact;
use App\Homedata;
use App\HomeUl;
use App\AboutAS;
use Illuminate\Http\Request;

class AdminController extends Controller
{
// about as
public function index(Request $request){
return redirect('admin/about');
}
// about as
public function about(Request $request){
$about = AboutAS::first();
return view('auth/admin/about' , ['about' => $about]);
}
public function aboutSave(Request $request){
$text = $request['text'];

$about_new = AboutAS::first();
$about_id = $about_new['id'];
if($about_id){
$about = AboutAS::find($about_id);
}else{
$about = new AboutAS;
}
$about['text'] = $text;
$about->save();
return redirect()->route('adminAbout');
}
// contact

public function contact(Request $request){
$contact = Contact::first();
return view('auth/admin/contact' , ['contact' => $contact]);
}
public function contactSave(Request $request){
$phone = $request['phone'];
$fax= $request['fax'];
$email = $request['email'];
$address = $request['address'];

$contact_new = Contact::first();
$contact_id = $contact_new['id'];
if($contact_id){
$contact = Contact::find($contact_id);
}else{
$contact = new Contact;
}
$contact['phone'] = $phone;
$contact['fax'] = $fax;
$contact['email'] = $email;
$contact['address'] = $address;
$contact->save();
return redirect()->route('contact');
}

// home data

public function homeData(Request $request){
return view('auth/admin/homeData');
}

public function homeDataView(){
$datas = Homedata::all()->toArray();
return view('auth/admin/homeDataView' , ['datas' => $datas]);
}

public function homeDatadelete($id){
$dataDelete = Homedata::find($id);
$dataDelete->delete();
return redirect()->route('homeDataView');
}

public function homeDataSave(Request $request){
$name = $request['name'];
$description= $request['description'];

$homeData_id = $request['id'];
if($homeData_id){
$homeData = Homedata::find($homeData_id);
}else{
$homeData = new Homedata();
}
$homeData['name'] = $name;
$homeData['description'] = $description;
$homeData->save();
return redirect()->route('homeDataView');
}

// home content

public function homeUl(Request $request){
return view('auth/admin/homeUl');
}

public function homeUlView(){
$datas = HomeUl::all()->toArray();
return view('auth/admin/homeUlView' , ['datas' => $datas]);
}

public function homeUldelete($id){
$dataDelete = HomeUl::find($id);
$dataDelete->delete();
return redirect()->route('homeUlView');
}

public function homeUlSave(Request $request){
$leftName = $request['left_name'];
$rightName= $request['right_name'];

$homeUl_id = $request['id'];
if($homeUl_id){
$homeUl = HomeUl::find($homeUl_id);
}else{
$homeUl = new HomeUl();
}
$homeUl['left_name'] = "$leftName";
$homeUl['right_name'] = "$rightName";
$homeUl->save();
return redirect()->route('homeUlView');
}
}
32 changes: 32 additions & 0 deletions app/Http/Controllers/Auth/ForgotPasswordController.php
Original file line number 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');
}
}
39 changes: 39 additions & 0 deletions app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;

class LoginController extends Controller
{
/*
|--------------------------------------------------------------------------
| Login Controller
|--------------------------------------------------------------------------
|
| This controller handles authenticating users for the application and
| redirecting them to your home screen. The controller uses a trait
| to conveniently provide its functionality to your applications.
|
*/

use AuthenticatesUsers;

/**
* Where to redirect users after login.
*
* @var string
*/
protected $redirectTo = '/home';

/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest')->except('logout');
}
}
Loading

0 comments on commit 9bde00a

Please sign in to comment.