URL Shortener 1.0
A Laravel-based URL shortener application
Chargement...
Recherche...
Aucune correspondance
ShortUrl.php
Aller à la documentation de ce fichier.
1<?php
2
3namespace App\Models;
4
5use Illuminate\Database\Eloquent\Model;
6use Illuminate\Database\Eloquent\Factories\HasFactory;
7use Illuminate\Database\Eloquent\SoftDeletes;
8use Illuminate\Auth\Access\HandlesAuthorization;
9
21class ShortUrl extends Model
22{
23 use HasFactory, SoftDeletes;
24
25 protected $fillable = [
26 'user_id',
27 'code',
28 'original_url'
29 ];
30
36 public function user()
37 {
38 return $this->belongsTo(User::class);
39 }
40}
user()
Get the user that owns the short URL.
Definition ShortUrl.php:36