first commit
This commit is contained in:
42
app/Console/Kernel.php
Executable file
42
app/Console/Kernel.php
Executable file
@ -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');
|
||||
}
|
||||
}
|
55
app/Exceptions/Handler.php
Executable file
55
app/Exceptions/Handler.php
Executable file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
use Throwable;
|
||||
|
||||
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 \Throwable $exception
|
||||
* @return void
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function report(Throwable $exception)
|
||||
{
|
||||
parent::report($exception);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render an exception into an HTTP response.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Throwable $exception
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function render($request, Throwable $exception)
|
||||
{
|
||||
return parent::render($request, $exception);
|
||||
}
|
||||
}
|
13
app/Http/Controllers/Controller.php
Executable file
13
app/Http/Controllers/Controller.php
Executable file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
|
||||
class Controller extends BaseController
|
||||
{
|
||||
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
|
||||
}
|
47
app/Http/Controllers/CountryController.php
Executable file
47
app/Http/Controllers/CountryController.php
Executable file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Country;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class CountryController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$countries = Country::orderBy('id','desc')->get();
|
||||
|
||||
return view('country.index', compact('countries'));
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('country.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
Country::create();
|
||||
|
||||
return redirect()->route('countries.index')->with('success','country has been created successfully.');
|
||||
}
|
||||
|
||||
public function edit(Country $country)
|
||||
{
|
||||
return view('country.edit',compact('country'));
|
||||
}
|
||||
|
||||
public function update(Request $request, Country $country)
|
||||
{
|
||||
$country->updated_at = time();
|
||||
$country->save();
|
||||
|
||||
return redirect()->route('countries.index')->with('success','country Has Been updated successfully');
|
||||
}
|
||||
|
||||
public function destroy(Country $country)
|
||||
{
|
||||
$country->delete();
|
||||
return redirect()->route('countries.index')->with('success','country has been deleted successfully');
|
||||
}
|
||||
}
|
103
app/Http/Controllers/ProjectController.php
Executable file
103
app/Http/Controllers/ProjectController.php
Executable file
@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Project;
|
||||
use App\Models\Region;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ProjectController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$projects = Project::orderBy('id', 'desc')->get();
|
||||
|
||||
return view('project.index', compact('projects'));
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$regions = Region::all();
|
||||
|
||||
return view('project.create', compact('regions'));
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'region_id' => 'required',
|
||||
'apartments' => 'required',
|
||||
'floors' => 'required',
|
||||
'card_image' => 'required|image|mimes:jpeg,png,jpg,gif,svg',
|
||||
'background_image' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg',
|
||||
'logo' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg',
|
||||
'yard_image' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg',
|
||||
'hall_image' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg',
|
||||
'slug' => 'required|unique:projects',
|
||||
]);
|
||||
$project = new Project();
|
||||
$project->fill($request->post());
|
||||
if ($request->post('status') == null) {
|
||||
$project->status = 1;
|
||||
}
|
||||
$project->card_image = $this->uploadImage('card_image', $request);
|
||||
$project->background_image = $this->uploadImage('background_image', $request);
|
||||
$project->logo = $this->uploadImage('logo', $request);
|
||||
$project->yard_image = $this->uploadImage('yard_image', $request);
|
||||
$project->hall_image = $this->uploadImage('hall_image', $request);
|
||||
|
||||
$project->save();
|
||||
|
||||
return redirect()->route('projects.index')->with('success', 'project has been created successfully.');
|
||||
}
|
||||
|
||||
public function edit(Project $project)
|
||||
{
|
||||
$regions = Region::all();
|
||||
|
||||
return view('project.edit', compact('project', 'regions'));
|
||||
}
|
||||
|
||||
public function update(Request $request, Project $project)
|
||||
{
|
||||
$request->validate([
|
||||
'region_id' => 'required',
|
||||
'apartments' => 'required',
|
||||
'floors' => 'required',
|
||||
'card_image' => 'image|mimes:jpeg,png,jpg,gif,svg',
|
||||
'background_image' => 'image|mimes:jpeg,png,jpg,gif,svg',
|
||||
'logo' => 'image|mimes:jpeg,png,jpg,gif,svg',
|
||||
'yard_image' => 'image|mimes:jpeg,png,jpg,gif,svg',
|
||||
'hall_image' => 'image|mimes:jpeg,png,jpg,gif,svg',
|
||||
]);
|
||||
|
||||
$project->fill($request->post());
|
||||
if ($request->post('status') == null) {
|
||||
$project->status = 1;
|
||||
}
|
||||
$project->card_image = $this->uploadImage('card_image', $request);
|
||||
$project->background_image = $this->uploadImage('background_image', $request);
|
||||
$project->logo = $this->uploadImage('logo', $request);
|
||||
$project->yard_image = $this->uploadImage('yard_image', $request);
|
||||
$project->hall_image = $this->uploadImage('hall_image', $request);
|
||||
|
||||
$project->save();
|
||||
|
||||
return redirect()->route('projects.index')->with('success', 'project Has Been updated successfully');
|
||||
}
|
||||
|
||||
public function destroy(Project $project)
|
||||
{
|
||||
$project->delete();
|
||||
return redirect()->route('projects.index')->with('success', 'project has been deleted successfully');
|
||||
}
|
||||
|
||||
public function uploadImage($attribute, $request)
|
||||
{
|
||||
if ($request->file($attribute)) {
|
||||
$request->file($attribute)->move(public_path() . '/uploads/images/', $request->file($attribute)->getClientOriginalName());
|
||||
|
||||
return $request->file($attribute)->getClientOriginalName();
|
||||
}
|
||||
}
|
||||
}
|
58
app/Http/Controllers/RegionController.php
Executable file
58
app/Http/Controllers/RegionController.php
Executable file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Country;
|
||||
use App\Models\Region;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class RegionController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$regions = Region::orderBy('id','desc')->get();
|
||||
|
||||
return view('region.index', compact('regions'));
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$countries = Country::all();
|
||||
|
||||
return view('region.create', compact('countries'));
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'country_id' => 'required',
|
||||
]);
|
||||
Region::create($request->post());
|
||||
|
||||
return redirect()->route('regions.index')->with('success','region has been created successfully.');
|
||||
}
|
||||
|
||||
public function edit(Region $region)
|
||||
{
|
||||
$countries = Country::all();
|
||||
|
||||
return view('region.edit',compact('region', 'countries'));
|
||||
}
|
||||
|
||||
public function update(Request $request, Region $region)
|
||||
{
|
||||
$request->validate([
|
||||
'country_id' => 'required',
|
||||
]);
|
||||
|
||||
$region->fill($request->post())->save();
|
||||
|
||||
return redirect()->route('regions.index')->with('success','regions Has Been updated successfully');
|
||||
}
|
||||
|
||||
public function destroy(Region $region)
|
||||
{
|
||||
$region->delete();
|
||||
return redirect()->route('regions.index')->with('success','regions has been deleted successfully');
|
||||
}
|
||||
}
|
82
app/Http/Kernel.php
Executable file
82
app/Http/Kernel.php
Executable file
@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http;
|
||||
|
||||
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
||||
|
||||
class Kernel extends HttpKernel
|
||||
{
|
||||
/**
|
||||
* The application's global HTTP middleware stack.
|
||||
*
|
||||
* These middleware are run during every request to your application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $middleware = [
|
||||
\App\Http\Middleware\TrustProxies::class,
|
||||
\App\Http\Middleware\CheckForMaintenanceMode::class,
|
||||
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
|
||||
\App\Http\Middleware\TrimStrings::class,
|
||||
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
|
||||
];
|
||||
|
||||
/**
|
||||
* The application's route middleware groups.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $middlewareGroups = [
|
||||
'web' => [
|
||||
\App\Http\Middleware\EncryptCookies::class,
|
||||
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
|
||||
\Illuminate\Session\Middleware\StartSession::class,
|
||||
// \Illuminate\Session\Middleware\AuthenticateSession::class,
|
||||
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
||||
\App\Http\Middleware\VerifyCsrfToken::class,
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
],
|
||||
|
||||
'api' => [
|
||||
'throttle:60,1',
|
||||
'bindings',
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* The application's route middleware.
|
||||
*
|
||||
* These middleware may be assigned to groups or used individually.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $routeMiddleware = [
|
||||
'auth' => \App\Http\Middleware\Authenticate::class,
|
||||
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
|
||||
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
|
||||
'can' => \Illuminate\Auth\Middleware\Authorize::class,
|
||||
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
|
||||
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
|
||||
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
|
||||
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
|
||||
];
|
||||
|
||||
/**
|
||||
* The priority-sorted list of middleware.
|
||||
*
|
||||
* This forces non-global middleware to always be in the given order.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $middlewarePriority = [
|
||||
\Illuminate\Session\Middleware\StartSession::class,
|
||||
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
||||
\App\Http\Middleware\Authenticate::class,
|
||||
\Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||
\Illuminate\Session\Middleware\AuthenticateSession::class,
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
\Illuminate\Auth\Middleware\Authorize::class,
|
||||
];
|
||||
}
|
21
app/Http/Middleware/Authenticate.php
Executable file
21
app/Http/Middleware/Authenticate.php
Executable file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Auth\Middleware\Authenticate as Middleware;
|
||||
|
||||
class Authenticate extends Middleware
|
||||
{
|
||||
/**
|
||||
* Get the path the user should be redirected to when they are not authenticated.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return string
|
||||
*/
|
||||
protected function redirectTo($request)
|
||||
{
|
||||
if (! $request->expectsJson()) {
|
||||
return route('login');
|
||||
}
|
||||
}
|
||||
}
|
17
app/Http/Middleware/CheckForMaintenanceMode.php
Executable file
17
app/Http/Middleware/CheckForMaintenanceMode.php
Executable file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode as Middleware;
|
||||
|
||||
class CheckForMaintenanceMode extends Middleware
|
||||
{
|
||||
/**
|
||||
* The URIs that should be reachable while maintenance mode is enabled.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $except = [
|
||||
//
|
||||
];
|
||||
}
|
17
app/Http/Middleware/EncryptCookies.php
Executable file
17
app/Http/Middleware/EncryptCookies.php
Executable file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
|
||||
|
||||
class EncryptCookies extends Middleware
|
||||
{
|
||||
/**
|
||||
* The names of the cookies that should not be encrypted.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $except = [
|
||||
//
|
||||
];
|
||||
}
|
26
app/Http/Middleware/RedirectIfAuthenticated.php
Executable file
26
app/Http/Middleware/RedirectIfAuthenticated.php
Executable file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class RedirectIfAuthenticated
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @param string|null $guard
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next, $guard = null)
|
||||
{
|
||||
if (Auth::guard($guard)->check()) {
|
||||
return redirect('/home');
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
18
app/Http/Middleware/TrimStrings.php
Executable file
18
app/Http/Middleware/TrimStrings.php
Executable file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
|
||||
|
||||
class TrimStrings extends Middleware
|
||||
{
|
||||
/**
|
||||
* The names of the attributes that should not be trimmed.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $except = [
|
||||
'password',
|
||||
'password_confirmation',
|
||||
];
|
||||
}
|
28
app/Http/Middleware/TrustProxies.php
Executable file
28
app/Http/Middleware/TrustProxies.php
Executable file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Http\Middleware\TrustProxies as Middleware;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class TrustProxies extends Middleware
|
||||
{
|
||||
/**
|
||||
* The trusted proxies for this application.
|
||||
*
|
||||
* @var array|string
|
||||
*/
|
||||
protected $proxies;
|
||||
|
||||
/**
|
||||
* The headers that should be used to detect proxies.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $headers =
|
||||
Request::HEADER_X_FORWARDED_FOR |
|
||||
Request::HEADER_X_FORWARDED_HOST |
|
||||
Request::HEADER_X_FORWARDED_PORT |
|
||||
Request::HEADER_X_FORWARDED_PROTO |
|
||||
Request::HEADER_X_FORWARDED_AWS_ELB;
|
||||
}
|
24
app/Http/Middleware/VerifyCsrfToken.php
Executable file
24
app/Http/Middleware/VerifyCsrfToken.php
Executable file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
|
||||
|
||||
class VerifyCsrfToken extends Middleware
|
||||
{
|
||||
/**
|
||||
* Indicates whether the XSRF-TOKEN cookie should be set on the response.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $addHttpCookie = true;
|
||||
|
||||
/**
|
||||
* The URIs that should be excluded from CSRF verification.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $except = [
|
||||
//
|
||||
];
|
||||
}
|
18
app/Models/Advantage.php
Executable file
18
app/Models/Advantage.php
Executable file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Advantage extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable=['icon'];
|
||||
|
||||
public function translations()
|
||||
{
|
||||
return $this->hasMany(AdvantageTranslation::class);
|
||||
}
|
||||
}
|
13
app/Models/AdvantageTranslation.php
Executable file
13
app/Models/AdvantageTranslation.php
Executable file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class AdvantageTranslation extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable=['project_advantage_id','localization_id','title','description'];
|
||||
}
|
18
app/Models/Area.php
Executable file
18
app/Models/Area.php
Executable file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Area extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable=['room_type_id','name'];
|
||||
|
||||
public function flat()
|
||||
{
|
||||
return $this->hasOne(Flat::class);
|
||||
}
|
||||
}
|
23
app/Models/Company.php
Executable file
23
app/Models/Company.php
Executable file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Company extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable=['image'];
|
||||
|
||||
public function translations()
|
||||
{
|
||||
return $this->hasMany(CompanyTranslation::class);
|
||||
}
|
||||
|
||||
public function images()
|
||||
{
|
||||
return $this->hasMany(CompanyImage::class);
|
||||
}
|
||||
}
|
13
app/Models/CompanyImage.php
Executable file
13
app/Models/CompanyImage.php
Executable file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class CompanyImage extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable=['company_id','image'];
|
||||
}
|
13
app/Models/CompanyTranslation.php
Executable file
13
app/Models/CompanyTranslation.php
Executable file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class CompanyTranslation extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable=['company_id','localization_id','title','body','second_block_title','second_block_text', 'booklet'];
|
||||
}
|
18
app/Models/Contact.php
Executable file
18
app/Models/Contact.php
Executable file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Contact extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable=['phone','email','location','facebook','instagram','whatsapp','vk','youtube'];
|
||||
|
||||
public function translations()
|
||||
{
|
||||
return $this->hasMany(ContactTranslation::class);
|
||||
}
|
||||
}
|
13
app/Models/ContactTranslation.php
Executable file
13
app/Models/ContactTranslation.php
Executable file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ContactTranslation extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable=['contact_id','localization_id','address'];
|
||||
}
|
19
app/Models/Country.php
Executable file
19
app/Models/Country.php
Executable file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Country extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable=[];
|
||||
|
||||
public function translations()
|
||||
{
|
||||
return $this->hasMany(CountryTranslation::class);
|
||||
}
|
||||
|
||||
}
|
13
app/Models/CountryTranslation.php
Executable file
13
app/Models/CountryTranslation.php
Executable file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class CountryTranslation extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable=['country_id','localization_id','name'];
|
||||
}
|
22
app/Models/Event.php
Executable file
22
app/Models/Event.php
Executable file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Event extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable=['project_id','image','date'];
|
||||
|
||||
protected $casts = [
|
||||
'date' => 'date:d.m.Y',
|
||||
];
|
||||
|
||||
public function translations()
|
||||
{
|
||||
return $this->hasMany(EventTranslation::class);
|
||||
}
|
||||
}
|
13
app/Models/EventTranslation.php
Executable file
13
app/Models/EventTranslation.php
Executable file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class EventTranslation extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable=['event_id','localization_id','title','description'];
|
||||
}
|
29
app/Models/Flat.php
Executable file
29
app/Models/Flat.php
Executable file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Flat extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable=['project_id','area_id','floor_number','price','price_for_m2','image','number'];
|
||||
|
||||
public function translations()
|
||||
{
|
||||
return $this->hasMany(FlatTranslation::class);
|
||||
}
|
||||
|
||||
public function images()
|
||||
{
|
||||
return $this->hasMany(FlatImage::class);
|
||||
}
|
||||
|
||||
public function area()
|
||||
{
|
||||
return $this->belongsTo(Area::class);
|
||||
}
|
||||
|
||||
}
|
14
app/Models/FlatImage.php
Executable file
14
app/Models/FlatImage.php
Executable file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class FlatImage extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable=['flat_id','image'];
|
||||
|
||||
}
|
13
app/Models/FlatTranslation.php
Executable file
13
app/Models/FlatTranslation.php
Executable file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class FlatTranslation extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable=['flat_id','localization_id','name','description','place','room_number','body'];
|
||||
}
|
13
app/Models/Lead.php
Executable file
13
app/Models/Lead.php
Executable file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Lead extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable=['name','phone','project'];
|
||||
}
|
14
app/Models/Localization.php
Executable file
14
app/Models/Localization.php
Executable file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Localization extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable=['name'];
|
||||
|
||||
}
|
18
app/Models/Post.php
Executable file
18
app/Models/Post.php
Executable file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Post extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable=['image','slug'];
|
||||
|
||||
public function translations()
|
||||
{
|
||||
return $this->hasMany(FlatTranslation::class);
|
||||
}
|
||||
}
|
13
app/Models/PostTranslation.php
Executable file
13
app/Models/PostTranslation.php
Executable file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class PostTranslation extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable=['post_id','localization_id','title','description','body'];
|
||||
}
|
18
app/Models/Program.php
Executable file
18
app/Models/Program.php
Executable file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Program extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable=['image_card','image_background','slug','images'];
|
||||
|
||||
public function translations()
|
||||
{
|
||||
return $this->hasMany(ProgramTranslation::class);
|
||||
}
|
||||
}
|
13
app/Models/ProgramTranslation.php
Executable file
13
app/Models/ProgramTranslation.php
Executable file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ProgramTranslation extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable=['program_id','localization_id','title','description','body'];
|
||||
}
|
50
app/Models/Project.php
Executable file
50
app/Models/Project.php
Executable file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Project extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable=['region_id','apartments','floors','card_image','background_image','logo','status','3d_tour_one','3d_tour_two','yard_image','hall_image','location','slug'];
|
||||
|
||||
protected $attributes=['status'=>1];
|
||||
|
||||
public function translations()
|
||||
{
|
||||
return $this->hasMany(AdvantageTranslation::class);
|
||||
}
|
||||
|
||||
public function region()
|
||||
{
|
||||
return $this->belongsTo(Region::class);
|
||||
}
|
||||
|
||||
public function flats()
|
||||
{
|
||||
return $this->hasMany(Flat::class);
|
||||
}
|
||||
|
||||
public function events()
|
||||
{
|
||||
return $this->hasMany(Event::class);
|
||||
}
|
||||
|
||||
public function roomTypes()
|
||||
{
|
||||
return $this->hasMany(RoomType::class);
|
||||
}
|
||||
|
||||
public function images()
|
||||
{
|
||||
return $this->hasMany(ProjectImage::class);
|
||||
}
|
||||
|
||||
public function advantages()
|
||||
{
|
||||
return $this->belongsToMany(ProjectAdvantage::class, 'project_advantages_project');
|
||||
}
|
||||
}
|
18
app/Models/ProjectAdvantage.php
Executable file
18
app/Models/ProjectAdvantage.php
Executable file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ProjectAdvantage extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable=['icon'];
|
||||
|
||||
public function translations()
|
||||
{
|
||||
return $this->hasMany(ProjectAdvantageTranslation::class);
|
||||
}
|
||||
}
|
13
app/Models/ProjectAdvantageTranslation.php
Executable file
13
app/Models/ProjectAdvantageTranslation.php
Executable file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ProjectAdvantageTranslation extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable=['project_advantage_id','localization_id','title'];
|
||||
}
|
13
app/Models/ProjectImage.php
Executable file
13
app/Models/ProjectImage.php
Executable file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ProjectImage extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable=['project_id','image'];
|
||||
}
|
13
app/Models/ProjectTranslation.php
Executable file
13
app/Models/ProjectTranslation.php
Executable file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ProjectTranslation extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable=['project_id','localization_id','name','body','addres','yard_text','hall_text','booklet'];
|
||||
}
|
23
app/Models/Region.php
Executable file
23
app/Models/Region.php
Executable file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Region extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable=['country_id'];
|
||||
|
||||
public function translations()
|
||||
{
|
||||
return $this->hasMany(RegionTranslation::class);
|
||||
}
|
||||
|
||||
public function projects()
|
||||
{
|
||||
return $this->hasMany(Project::class);
|
||||
}
|
||||
}
|
13
app/Models/RegionTranslation.php
Executable file
13
app/Models/RegionTranslation.php
Executable file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class RegionTranslation extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable=['region_id', 'localization_id', 'name'];
|
||||
}
|
29
app/Models/RoomType.php
Executable file
29
app/Models/RoomType.php
Executable file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class RoomType extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable=['project_id'];
|
||||
|
||||
public function translations()
|
||||
{
|
||||
return $this->hasMany(RoomTypeTranslation::class);
|
||||
}
|
||||
|
||||
public function areas()
|
||||
{
|
||||
return $this->hasMany(Area::class);
|
||||
}
|
||||
|
||||
public function project()
|
||||
{
|
||||
return $this->belongsTo(Project::class);
|
||||
}
|
||||
|
||||
}
|
13
app/Models/RoomTypeTranslation.php
Executable file
13
app/Models/RoomTypeTranslation.php
Executable file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class RoomTypeTranslation extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable=['room_type_id','localization_id','name'];
|
||||
}
|
13
app/Models/Slider.php
Executable file
13
app/Models/Slider.php
Executable file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Slider extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable=['image','url'];
|
||||
}
|
13
app/Models/Statistic.php
Executable file
13
app/Models/Statistic.php
Executable file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Statistic extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable=['num_projects','num_clients','year','area'];
|
||||
}
|
44
app/Models/User.php
Executable file
44
app/Models/User.php
Executable file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Laravel\Sanctum\HasApiTokens;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
use HasApiTokens, HasFactory, Notifiable;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'email',
|
||||
'password',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for serialization.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password',
|
||||
'remember_token',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast.
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected $casts = [
|
||||
'email_verified_at' => 'datetime',
|
||||
];
|
||||
}
|
28
app/Providers/AppServiceProvider.php
Executable file
28
app/Providers/AppServiceProvider.php
Executable file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
30
app/Providers/AuthServiceProvider.php
Executable file
30
app/Providers/AuthServiceProvider.php
Executable file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
|
||||
class AuthServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The policy mappings for the application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $policies = [
|
||||
// 'App\Model' => 'App\Policies\ModelPolicy',
|
||||
];
|
||||
|
||||
/**
|
||||
* Register any authentication / authorization services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
$this->registerPolicies();
|
||||
|
||||
//
|
||||
}
|
||||
}
|
21
app/Providers/BroadcastServiceProvider.php
Executable file
21
app/Providers/BroadcastServiceProvider.php
Executable file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Broadcast;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class BroadcastServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
Broadcast::routes();
|
||||
|
||||
require base_path('routes/channels.php');
|
||||
}
|
||||
}
|
34
app/Providers/EventServiceProvider.php
Executable file
34
app/Providers/EventServiceProvider.php
Executable file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Auth\Events\Registered;
|
||||
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
|
||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
class EventServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The event listener mappings for the application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $listen = [
|
||||
Registered::class => [
|
||||
SendEmailVerificationNotification::class,
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Register any events for your application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
//
|
||||
}
|
||||
}
|
82
app/Providers/RouteServiceProvider.php
Executable file
82
app/Providers/RouteServiceProvider.php
Executable file
@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
class RouteServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The path to the "home" route for your application.
|
||||
*
|
||||
* This is used by Laravel authentication to redirect users after login.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
// public const HOME = '/home';
|
||||
|
||||
/**
|
||||
* This namespace is applied to your controller routes.
|
||||
*
|
||||
* In addition, it is set as the URL generator's root namespace.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $namespace = 'App\Http\Controllers';
|
||||
|
||||
/**
|
||||
* Define your route model bindings, pattern filters, etc.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
//
|
||||
|
||||
parent::boot();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the routes for the application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function map()
|
||||
{
|
||||
$this->mapApiRoutes();
|
||||
|
||||
$this->mapWebRoutes();
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "web" routes for the application.
|
||||
*
|
||||
* These routes all receive session state, CSRF protection, etc.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function mapWebRoutes()
|
||||
{
|
||||
Route::middleware('web')
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/web.php'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "api" routes for the application.
|
||||
*
|
||||
* These routes are typically stateless.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function mapApiRoutes()
|
||||
{
|
||||
Route::prefix('api')
|
||||
->middleware('api')
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/api.php'));
|
||||
}
|
||||
}
|
39
app/User.php
Executable file
39
app/User.php
Executable file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
use Notifiable;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name', 'email', 'password',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for arrays.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password', 'remember_token',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'email_verified_at' => 'datetime',
|
||||
];
|
||||
}
|
13
app/helpers.php
Executable file
13
app/helpers.php
Executable file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
function active_class($path, $active = 'active') {
|
||||
return call_user_func_array('Request::is', (array)$path) ? $active : '';
|
||||
}
|
||||
|
||||
function is_active_route($path) {
|
||||
return call_user_func_array('Request::is', (array)$path) ? 'true' : 'false';
|
||||
}
|
||||
|
||||
function show_class($path) {
|
||||
return call_user_func_array('Request::is', (array)$path) ? 'show' : '';
|
||||
}
|
Reference in New Issue
Block a user