xxxxxxxxxx
// User model
public function phone()
{
return $this->hasOne(Phone::class);
}
// User controller
$phone = User::find(1)->phone;
xxxxxxxxxx
Schema::create('phones', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id')->unsigned();
$table->string('phone');
$table->timestamps();
$table->foreign('user_id')->references('id')->on('users')
->onDelete('cascade');
});
xxxxxxxxxx
# pip install googletrans
from googletrans import Translator
translator = Translator()
print(translator.translate("Traduisez des langues avec python.").text)